Regex Tester (JavaScript)
Enter a pattern, choose flags and paste test text to see every match highlighted, a table of capture groups and a live replace preview. It uses the JavaScript (ECMAScript) regular expression engine in your browser, so syntax can differ from PCRE, Python or Java. Matching runs in a Worker with a 1.5 second timeout to stop catastrophic backtracking.
Runs in your browser
Free, no sign-up. Matching runs in a Web Worker in your browser. Patterns and text are never uploaded, stored, put in URLs or sent to analytics.
JavaScript (ECMAScript) RegExp flavor. Your pattern and text are processed in this tab and never uploaded or sent to analytics.
Highlighted matches
Contact ada@example.com or grace@example.org for details.How to use the Regex Tester
- Type a pattern without the surrounding slashes.
- Toggle the flags you need: g, i, m, s, u, y or d.
- Paste or type the test text.
- Review highlighted matches and the groups table with indices and named groups.
- Optionally enter a replacement (supports $1, $<name> and $&) to preview the result.
- Copy the pattern, the replaced text or a summary.
Worked example
Sample data
Pattern: (?<user>[\w.]+)@(?<domain>[\w.-]+\.[a-z]{2,})
Flags: gi
Text: Contact ada@example.com or grace@example.org for details.
Replacement: $<user> at $<domain>2 matches 1: "ada@example.com" (index 8-23) 2: "grace@example.org" (index 27-44) Replaced: Contact ada at example.com or grace at example.org for details.
user and domain are named groups and appear in the groups table for each match.
How it works
JavaScript flavor
The tester uses the JavaScript RegExp engine of your browser. Features such as named groups, lookbehind and Unicode property escapes depend on your browser version, and syntax that works in PCRE, Python or Java (for example possessive quantifiers or inline flags) may fail or behave differently.
Flags
g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode mode, y matches only at the last index (sticky), and d adds start and end indices for each group.
g i m s u y d
Catastrophic backtracking guard
Some patterns, such as (a+)+$ on a long run of a's followed by another character, can take exponential time. To keep the page responsive the match runs in a Web Worker that is terminated after 1.5 seconds and reports a timeout.
Limits: up to 200,000 characters of test text, 1,000 matches shown. If Workers are unavailable the tool runs on the main thread with a 20,000 character limit and no timeout protection.
Privacy
Patterns and text often contain real data such as logs or emails, so they are treated as sensitive. They stay in your browser, are never put in the URL and are never sent to analytics.
Inputs, outputs and limits
Inputs
- Pattern
- Flags g i m s u y d
- Test text up to 200,000 characters
- Optional replacement
Outputs
- Highlighted matches
- Match and capture-group table with named groups
- Replace preview
- Copy
Limits
- JavaScript engine only.
- 1.5 second timeout per run; 1,000 matches maximum.
- 20,000 character limit if Web Workers are unavailable.
- Group indices are shown only when the d flag is on.
Processing
- Matching runs in a Web Worker in your browser. Patterns and text are never uploaded, stored, put in URLs or sent to analytics.
Frequently asked questions
Why does my pattern work in Python but not here?
This tool uses JavaScript regex. Differences include inline flags, possessive quantifiers, atomic groups and named group syntax ((?P<name>) in Python versus (?<name>) in JavaScript).
What does the timeout mean?
The pattern took longer than 1.5 seconds on your text, often because of catastrophic backtracking. Make quantifiers more specific or avoid nested repeats.
Is my text sent anywhere?
No. It stays in your browser and is not sent to analytics or placed in the URL.
How do I see group positions?
Turn on the d flag; the table then shows start and end indices for each group.
Why do I see only the first match?
Enable the g flag to find all matches.
Need a custom internal tool or integration?
We build internal tools, APIs and integrations that fit your team's workflow, from a single admin screen to a full backend.