Developer Tools
Regular Expression Tester
Test a JavaScript regular expression against sample text and inspect matches.
Powering up the tool…
What this tool does
About the regular expression tester
The tool highlights capture groups, indexes and replacements using the browser JavaScript engine. It limits runaway work and identifies invalid flags.
How to use it
- Enter the pattern and flags — invalid flags are named, not swallowed.
- Paste sample text that includes the cases you fear, not just the happy path.
- Inspect the highlighted matches, group captures and indexes.
- Try a replacement string to preview substitutions with group references.
Useful for
- Build a pattern against real sample text instead of deploying and praying.
- See exactly what each capture group grabs before the pattern goes in code.
- Debug why a regex matches too much, too little or nothing at all.
Straight answers
Regular Expression Tester FAQ
Will this pattern behave the same in Python or PHP?
Mostly, but not always: this tester runs your browser’s JavaScript engine, and flavours differ on lookbehind details, named groups and escapes. Test in the destination language before shipping anything clever.
Why does my pattern freeze other testers but not this one?
Catastrophic backtracking — nested quantifiers exploding on non-matching input. This tool bounds runaway work so you discover the problem as a fast failure here rather than a hung process in production.