DEVELOPER & DATA

Regex Tester

Test a JavaScript regular expression live: every match highlighted with index and capture groups, named groups, flags, and a replacement preview.

All matches of a pattern in your text, listed with positions and groups and highlighted in place, a replacement preview with $1 / $<name>, and warnings for empty matches and catastrophic backtracking.

Example: (?<user>[\w.+-]+)@(?<domain>[\w-]+\.[\w.]+) finds three addresses in the sample, each with user and domain groups; $<user> at $<domain> rewrites them.

v0.1.0 · last reviewed 18 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Your browser's engine,
shown in the open.

Which flavour this is and why it matters, what the match list and groups mean, how replacement references work, and the two patterns that go wrong at scale.

Flavour

The pattern is compiled and run by your browser's own RegExp engine, so what you see is exactly what your JavaScript or TypeScript code will do — including lookbehind, named groups, Unicode property escapes with the u flag and the s (dotAll) flag. PCRE-only syntax (possessive quantifiers, \A and \Z, recursion, conditionals) is not supported, and Python, Go or grep may differ in details such as \b on Unicode text.

Matches, groups and replacement

Every match is listed with its start and end index and its capture groups, numbered or named; the text is highlighted in place. The replacement preview uses String.prototype.replace, so $1 … $9, $<name>, $& (whole match) and $$ (a literal dollar) work as in code. All matches are always listed for inspection; without the g flag the page notes that your code would stop at the first, and the replacement changes only that one.

Empty matches and backtracking

A pattern that can match zero characters (a* rather than a+) produces empty matches at many positions; the page lists them, warns, and never loops. Nested or stacked .* quantifiers can backtrack exponentially on long inputs (catastrophic backtracking); the page warns on the common shapes and caps the listing at 5,000 matches so the browser stays responsive.

What the tool does not settle

Whether a pattern is correct for every input is a question about your data, not the engine; test with real samples. Regular expressions are not the right tool for nested structures (HTML, JSON) — parse those. Text up to 1 MB is matched on your machine. Nothing is uploaded; the same four anonymous usage counts as the rest of the site apply.

SOURCES

Last reviewed 18 September 2026. How results are checked: How we verify.