Regex Tester
Test a regular expression against sample text and inspect what the pattern matches.
Pattern and test text
Enter a JavaScript pattern without surrounding slashes. The test runs in a separate worker and stops if it takes too long.
Result
Highlighted matches and captured groups.
Enter a pattern and select Test regular expression.
Runs in your browser. Nothing is uploaded.
Also known as: regular expression tester, regex matcher, test regex pattern
How to use
- Enter a JavaScript regular expression without the surrounding slashes.
- Set flags and paste your test text.
- Run the test and open a match to inspect its groups or offsets.
Frequently asked questions
Which regex syntax is used?
The JavaScript RegExp engine in your browser. Syntax from Python or PCRE may not work.
How do I find more than the first match?
Enable the g flag. Without it the tool reports only the first match.
What happens if a pattern takes too long?
The dedicated worker is stopped so the page stays usable. Reduce the text or simplify the pattern before retrying.
How are offsets counted?
They are zero-based UTF-16 indices, just like JavaScript string offsets. The d flag shows offsets for captured groups.