Regex tester
Enter a regular expression and a test string to see every match highlighted live, with capture groups listed. The pattern runs in a sandboxed worker that is stopped if it gets stuck, so the page stays responsive. Everything runs in your browser.
How to test a regular expression
- Type your regular expression and choose the flags you need.
- Paste the text to test it against.
- Read the highlighted matches and capture groups, and copy the matches if you need them.
About regular expressions
A regular expression is a compact pattern for finding and extracting text — matching things like email addresses, dates or words that follow a rule. Testing a pattern against real sample text is the fastest way to get it right, since a small change can match much more or much less than you expect.
This tester uses JavaScript's regex engine and highlights matches live, with capture groups broken out so you can see exactly what each part of the pattern caught. The pattern runs in a sandboxed worker that is stopped if it stalls, so even a runaway expression will not freeze the page — and nothing you type is uploaded.
Frequently asked questions
What does the regex tester do?
It runs your regular expression against the test string and highlights every match, listing each match position and its capture groups, updating live as you edit the pattern, flags or text.
Which flags are supported?
Global (g), ignore case (i), multiline (m) and dotall (s). Global is on by default so all matches are found; toggle the others to suit your pattern.
What syntax does it use?
It uses JavaScript's built-in regular-expression engine, so the same syntax works here as in JavaScript — including named groups, lookahead and Unicode escapes.
Can a bad pattern freeze the page?
No. The pattern runs in a Web Worker that is terminated if it takes too long, so a catastrophically backtracking expression shows a "too complex" message instead of hanging the page.