Regex tester
Test regular expressions with live highlighting, match groups and replace preview. Uses the JavaScript regex engine.
How to use the regex tester
- Type a pattern and choose flags such as g and i.
- Paste text to test. Matches are highlighted and listed with their groups.
- Add a replacement to preview the result.
Frequently asked questions
Which regex flavor is this?
JavaScript (ECMAScript), the same as browsers and Node.js. It is very close to PCRE but has some differences, such as no possessive quantifiers.
Why did it say the pattern took too long?
Patterns with nested repeats like (a+)+ can take exponential time on some inputs. The tester stops after 1.5 seconds so the page doesn’t freeze.
How do I use groups in the replacement?
Use $1, $2 for numbered groups, $<name> for named groups and $& for the whole match.
Related tools
Everything runs in your browser. Your files and text are never uploaded.