Regex Tester
Test JavaScript regex matches, capture groups, named groups, and replacements safely.
Runs locally
Loading tool…
Loading tool…
How to use
Enter a JavaScript regex pattern without slash delimiters, toggle flags, and paste test text. Matching runs inside a dedicated browser Worker; work that exceeds one second is terminated to protect the page. Enable Replace to preview JavaScript replacement syntax such as $1 or $<name>. The table lists match indices, numbered groups, and named groups. The cheat sheet covers common constructs but does not change the pattern.
FAQ
How does the timeout prevent catastrophic backtracking?
The expression runs in a separate Worker. If it has not responded after one second, that Worker is terminated.
Which regex flavor is supported?
The tool uses the JavaScript RegExp implementation in your current browser.