Regex Tester
Test regular expressions live with highlighted matches and capture groups.
Regular expression
Private by design. Everything runs locally in your browser. Your input is never uploaded, logged or stored on a server.
How to use the Regex Tester
- Enter the pattern without the surrounding slashes.
- Toggle the flags you need: global, ignore case, multiline, dotall, unicode.
- Paste the text to test against and read the highlighted matches.
- Open a match to see its capture groups, or fill in a replacement to preview the rewrite.
A worked example
pattern (\d{4})-(\d{2}) against 2026-08-11match 2026-08 · group 1 2026 · group 2 08
The match stops at the second group because nothing in the pattern consumes the rest. Reading the groups, rather than the match, is usually what tells you the pattern is subtly wrong.
Frequently asked questions
Which regex flavour does this use?
JavaScript (ECMAScript). Lookbehind, named groups, sticky and unicode flags are all supported by current browsers. PCRE-only constructs such as recursion are not available.
What do the flags mean?
g finds every match rather than stopping at the first, i ignores case, m makes ^ and $ match at line boundaries, s lets . match newlines, and u enables full Unicode handling.
Why does my pattern match nothing?
Most often an unescaped special character. Literal dots, plus signs, parentheses and question marks all need a backslash. Check the error message under the pattern field first.
Is my test data private?
Yes. Both the pattern and the test string stay in your browser and are never transmitted.
About the Regex Tester
This tester uses the browser own JavaScript regular-expression engine, so behaviour matches exactly what your code will do — no dialect differences to account for.
Matches are highlighted in the test string as you type and listed with their index and named or numbered capture groups. The replace panel previews String.replace output, including $1 backreferences and $<name> named references.
Catastrophic backtracking is the failure mode to watch for. Nested quantifiers over the same character class, such as (a+)+$, can take exponential time on a non-matching input. The tester aborts a match that runs too long rather than freezing the page.
Maintained by Ikonode. Last checked against the code on 11 September 2026.
What it does not do
- JavaScript (ECMAScript) syntax. Recursion, atomic groups and possessive quantifiers are PCRE features and are not available here.
- A pattern that matches too slowly is stopped early rather than being allowed to hang the tab — that is a warning about the pattern, not a bug in the tester.
- Matching happens on the text you paste; it does not read files or crawl a site.