Regex Tester
Test regular expressions against your text safely.
Runs in your browser — your text never leaves your device.
Save this tool
Keep Regex Tester handy
Use your browser's Share menu, then “Add to Home Screen”.
About this tool
Regular expressions are compact and unforgiving, and the usual way to learn one is to change a character and see what happens. This tester makes that loop immediate: matches highlight as you type, every capture group is listed with its value, and syntax errors are reported in plain terms rather than silently returning nothing. It uses your browser's own JavaScript regex engine, so what you see is exactly what your code will do, including flag behaviour and named groups. One thing worth knowing is that this runs your pattern in a background thread rather than on the page. Certain patterns, notably nested repetition like the classic parenthesised a plus repeated, can take exponentially long on some inputs, and JavaScript offers no way to interrupt a regex once it has started. Most online testers freeze the tab when that happens. Here the background thread is simply discarded and you are told the pattern took too long, which is also a useful warning that the same pattern would stall your server.
How to use it
- Type your pattern and pick the flags you need
- Paste the text to test it against
- Read the highlighted matches and capture groups below
Frequently asked questions
Which regex flavour is this?
JavaScript, using your browser's own engine. That means what you see here is exactly what your JavaScript or TypeScript code will do. Patterns written for PCRE, Python or Go may behave differently, particularly around lookbehind and Unicode property escapes.
What does the timeout mean?
Your pattern took too long to finish. Nested repetition such as (a+)+ can take exponentially long on certain inputs, a problem known as catastrophic backtracking. It is a genuine warning: the same pattern in production would hang a request rather than just a browser tab.
Why does my pattern hang other regex testers but not this one?
Because the match runs in a background thread here. JavaScript cannot interrupt a running regex, so a tester that evaluates on the page has no way to recover and the tab freezes. A background thread can simply be discarded.
What is the difference between the global flag and no flag?
Without the global flag only the first match is returned. With it, matching continues through the whole string. It also changes how the engine tracks position between calls, which is a common source of surprising behaviour when a regex object is reused.
Are named capture groups supported?
Yes. Groups written as (?<name>...) are listed with their names alongside numbered groups, so you can confirm they capture what you expect before wiring them into code.