Regex Tester
Test a regular expression against your own text, with highlighted matches, capture groups and the exact error for an invalid pattern.
0 matches
Saving needs a Dex account. The tool never does.
How it works
- Type a pattern and pick your flags. Matches are highlighted in the test string as you type, and every match is listed with its index and capture groups.
- The pattern is always compiled global, because a tester that stopped at the first match would be useless. The i, m, s and u flags are one click each.
- An invalid pattern reports the engine message immediately rather than failing silently, which is usually the fastest way to find the stray bracket.
- Both the pattern and the text stay in the page. Nothing is sent anywhere, which matters when the test string is a real log line or a customer record.
Examples
Checking an email pattern before shipping it
Paste a few real addresses into the test string and confirm the pattern matches what it should. Checking the capture groups column shows whether the part you need is captured.
Finding a value in a log
Paste the log line, match the field, and read the index to see where it sits. Far quicker than scrolling a terminal for the right position.
Frequently asked questions
Which regular expression dialect is this?
JavaScript, because it runs in your browser. It supports lookahead, lookbehind, named groups and the u flag, but not constructs from PCRE or .NET such as atomic groups.
Why does my pattern match nothing?
The usual causes are an unescaped dot, a greedy quantifier consuming the rest of the line, or a missing flag: without m, ^ and $ anchor to the whole string rather than each line.
Can I test a replacement?
Not in this tool yet. The match list and capture groups are shown, which is what you need to write a replacement by hand.
Is my text uploaded?
No. Matching runs in the page and the pattern and text are never transmitted.