Tested regular expressions for emails, URLs, dates, IDs and more
Regex Tester
See exactly what a regular expression matches, what each group captures and what a replace would produce, as you type.
Loading tool…
How to use regex tester
Type a pattern between the slashes and switch flags such as g, i, m and s on or off.
Paste the text to search; every match is highlighted in place.
Read each match with its position and what every numbered or named group captured.
Switch to Replace to preview the text with $1, $<name> or $& substitutions.
What this tool does
- Runs in a background worker with a 1.5 second limit, so a pattern with catastrophic backtracking is stopped instead of freezing the page.
- Supports every JavaScript flag: g, i, m, s, u, y, d and v where the browser has it.
- Lists up to 5,000 matches with named groups labelled by name and unmatched groups marked.
- Opens directly with a pattern from the regex library or the escape tool.
How the result is verified
Matches come from the browser's own RegExp engine, the same one your JavaScript code uses, so what you see here is what your code will get.
Frequently asked questions
What is catastrophic backtracking?
Some patterns, often nested quantifiers like (a+)+ or (\w|\d)*, try exponentially many ways to match when the text almost fits. The tester stops any run after 1.5 seconds and tells you, rather than hanging.
Why do I only see one match?
Without the g flag a regular expression stops at the first match. Turn g on to find them all.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Escape special characters so text matches literally in a regex
Pull every match or capture group into a list, deduplicated and sorted
Split text on any regex, trim pieces and export as lines, JSON or CSV
Run JavaScript with a console and top level await, no network access