About this tool
Why it exists.
Regular expressions are brilliant right up to the moment they are not. This tester highlights matches as you type, lists captured groups with their indexes, and shows a replacement preview so you can catch over-matching before it reaches production.
Toggle the common flags (global, ignore case, multiline, dotAll). Invalid patterns produce the browser's own error message. The test runs against your input in the page; no text is uploaded and there is no server-side execution.
How to use it.
- Enter a pattern and choose flags.
- Paste a test string and inspect every highlighted match and group.
- Optionally add a replacement and copy the preview.
Good questions.
Do I include the slashes in the pattern field?
No. Enter only the pattern body, such as \b\w+@\w+\.\w+\b, and choose flags with the checkboxes. If you paste /pattern/gi from code, remove the outer slashes.
Why does the tool stop after a certain number of matches?
It limits matches to keep the page responsive and to avoid runaway loops from pathological patterns. A pattern with nested quantifiers can still be slow; simplify it if you notice a pause.
Which regex flavour is used?
It uses the regular expression engine built into your browser, which follows modern ECMAScript syntax including named groups and lookbehind in current browsers. It is not PCRE or .NET, so some advanced constructs differ.