How to use the Regex Tester
- Type your pattern (without slashes).
- Tick the flags you need.
- Paste test text and see matches highlighted.
- Check each match's groups on the right.
What does this tool do?
The tester uses JavaScript's regular expression engine, so results match what you'll get in browsers and Node.js. It shows every match with its position, numbered groups and named groups.
Patterns run in a separate background worker with a time limit. If a pattern triggers catastrophic backtracking, it's stopped instead of freezing your browser.
Why use it?
- Build and debug patterns quickly.
- See groups for search-and-replace.
- Safe against runaway patterns.
Example
Pattern (\w+)@(\w+)\.com with flags gi on “ada@example.com” matches the whole address, with “ada” as group 1 and “example” as group 2.
Accuracy and limits
- Other languages' regex engines (PCRE, Python, Java) are similar but not identical — for example in lookbehind and Unicode support.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.