Regex Tester
Type a JavaScript regular expression and test text. Matches highlight live, capture groups and indices show in a clean list, replace mode previews substitutions, and a cheat sheet keeps syntax close at hand.
Regex cheat sheet
Your patterns and test text are processed entirely in your browser.
How to use this regex tester
- Type your pattern between the / / and toggle flags (g, i, m, s, u, y).
- Paste your test text — every match highlights live with capture groups numbered.
- Switch to Replace mode to preview substitutions ($1, $2, $<name>, $&).
- Use the common patterns or open the cheat sheet for syntax help.
Frequently asked questions
Which regex flavor is supported?
JavaScript regex (ECMAScript), the same engine your browser uses. That's slightly different from PCRE / Python — most syntax overlaps but lookbehind support and certain Unicode classes vary.
Are matches limited?
The first 200 matches are listed in detail; the highlighter shows all of them. There's a 50,000-match safety stop for runaway patterns.
What about lookbehind?
Modern browsers support both lookahead (?=…)(?!…) and lookbehind (?<=…)(?<!…). The tester runs in your browser, so it matches your browser's exact regex behavior.
Is anything sent to a server?
No. Patterns and text stay in your browser.