Developer Tools
Regex Tester
Test a JavaScript regular expression on your text, with highlighted matches, groups, flags and a safe timeout.
- Free
- No sign-up
- Runs in your browser
Working…
This uses your browser’s JavaScript regular expressions. Your pattern and text stay in this page.
How to use Regex Tester
How to use this tool:
- Type your regular expression in the first box (without the slashes).
- Tick the flags you want. g finds every match; without it only the first is shown.
- Type or paste the text to test. Matches are highlighted and listed with their position and groups.
Details. This uses your browser's JavaScript regular expressions. Each run happens in a background worker that is stopped after about a second and a half, so a pattern with runaway backtracking, such as (a+)+$, cannot freeze the page. Text can be up to 50,000 characters and up to 500 matches are shown.
Tip. Anchor a validation pattern with ^ and $, or it will match a part of the text.
Examples
(\d{4})-(\d{2})-(\d{2})
Finds dates like 2026-10-31 and shows the year, month and day as groups 1, 2 and 3.
\b\w+@\w+\.com\b
Finds simple email-like words. Real email checking needs more than a pattern.
(a+)+$ on aaaa…a!
A classic slow pattern. The tester stops it and tells you instead of freezing.
Frequently asked questions
Which regular expression syntax is this?
JavaScript's, as built into your browser. Other languages differ in small ways.
Why was my expression stopped?
It took longer than about a second and a half, usually because of nested repeats that make the engine try a huge number of paths. Simplify it.
Why is only one match shown?
Tick the g flag to find all matches.
Is my text sent anywhere?
No. The pattern and text stay in your browser.
Guides about Regex Tester
Related tools
JSON Formatter and Validator
Format, minify and validate JSON with clear error messages.
Valid JSONUtilitiesWord Counter
Count words, characters, sentences and reading time as you type.
Count liveDeveloper ToolsURL Encoder and Decoder
Percent-encode text for use in a URL, or decode %20 and similar codes back to readable text.
%20