What the Regex Tester does
Enter a pattern, choose flags and paste test text. Matches are highlighted and listed with their position and capture groups. The tester uses JavaScript’s own regular-expression engine, so results match what your JavaScript code will do.
Patterns run inside a separate worker that is stopped after 1.5 seconds, so a pattern with catastrophic backtracking cannot freeze the page.
How to use it
- Type a pattern without slashes.
- Set flags such as g or i.
- Paste text and check the highlighted matches and groups.
Practical examples
- (\w+)@(\w+)\.com finds simple email-like strings.
- ^\d{3}-\d{4}$ with the m flag matches phone-like lines.
Features
- Live highlighting
- Capture groups and named groups
- Worker isolation with a time limit
- Up to 200,000 characters of test text
Limitations
- JavaScript syntax only; PCRE, Python or .NET features such as lookbehind in some engines may behave differently.
- Only the first 1,000 matches are returned.
- No replace preview in this version.
Privacy
This tool runs entirely in your browser. What you type is not sent to our servers and is discarded when you close or reload the page.
Frequently asked questions
Why was my pattern stopped?
It ran longer than 1.5 seconds, usually because of nested quantifiers such as (a+)+ that backtrack exponentially.
Does it work with other languages?
Syntax is similar, but each language has differences, so test in your target language too.