Regex Tester
Test JavaScript regular expressions against sample text with live match highlights, capture groups, and replacements.
How to Use Regex Tester in 3 Steps
Enter a pattern
Type a JavaScript regular expression between the slashes and toggle flags like g, i, or m. Click any cheat-sheet chip to insert syntax.
Paste a test string
Paste sample text or open a log file. Highlighted matches, character offsets, numbered groups, and named groups update as you type.
Test replacements or export
Select Replace to preview substitutions with $1, $<name>, and $& tokens. Copy the output or download matches as TXT or JSON.
Regex Cheat Sheet: Click to Insert
Characters
Quantifiers
Anchors
Groups
Lookaround
Common patterns
Regex Tester: Frequently Asked Questions
Which regular expression engine runs on this page?
It runs your browser native JavaScript (ECMAScript) RegExp engine. Named capture groups, lookbehind assertions, and Unicode property escapes with the u flag work natively.
Why did matching stop after 1.5 seconds?
Nested quantifiers such as (a+)+$ can cause catastrophic backtracking. A background worker cancels runaway evaluations after 1.5 seconds so your tab never freezes.
How do numbered and named capture groups work?
Every match card lists numbered groups and named groups like (?<year>\d{4}). Reference them in Replace mode with $1 or $<year>.
What are the input size and highlight limits?
File inputs accept up to 50 MB. Visual highlights render the first 200,000 characters and 2,000 matches, while Replace processes the full string.
Why does the y flag return zero matches?
The sticky (y) flag matches only from index 0 unless consecutive matches touch. Clear the y flag for normal global searches.
Is my input uploaded to a server?
No. Every calculation and parser runs locally inside your browser tab. Your code, secrets, cookies, and files never leave your device.
Explore All Dev Tools
Format, minify, inspect, and validate code and developer payloads locally.