Developer tool
Regex Tester
Validate JavaScript regular expressions, switch flags, and highlight every match against sample text.
Highlighted matches will appear hereAbout this tool
Build regular expressions with confidence
Regular expressions can extract, validate, and transform text, but small syntax changes can produce very different results. Immediate highlighting makes it easier to see exactly what a pattern captures.
This tester uses your browser’s JavaScript regex engine, reports syntax errors, supports common flags, and lists match indexes and captured groups. Long-running expressions are stopped automatically to protect responsiveness.
How it works
Test a regex in three steps
- 1Enter a pattern
Write a JavaScript regular expression without the surrounding slash characters.
- 2Choose flags
Toggle global, case-insensitive, multiline, dot-all, or Unicode behavior.
- 3Review matches
Paste sample text and inspect highlighted results, indexes, and captured groups.
Common questions
Regex Tester FAQ
Which regular expression syntax does this tester use?
It uses the JavaScript regular expression engine supported by your browser, including character classes, groups, lookarounds, backreferences, and Unicode patterns.
Which regex flags are available?
You can toggle global, case-insensitive, multiline, dot-all, and Unicode behavior using the g, i, m, s, and u flags.
Why do I see only one match?
Turn on the global g flag to continue searching after the first result. Without it, JavaScript regular expressions return only the first match.
Can a regular expression take too long?
Yes. Certain nested or ambiguous patterns can require excessive backtracking. This tester stops long-running evaluations to keep the page responsive.