Skip to content
DevTools

Regex Tester

pattern × text → matches

Highlight what a pattern matches, and list what each group captured.

pattern
//
flags
test string
matches
Contact ada@example.com or grace@example.com for access.
2 matches

capture groups

#atmatchgroups
18ada@example.com$1 ada$2 example
227grace@example.com$1 grace$2 example
replace with — supports $1 and $<name>

About Regex Tester

Write a pattern, paste the text you expect it to match, and every match is highlighted as you type. The table below lists each match with its character offset and the contents of every capture group, numbered and named, which is the part that usually reveals why a pattern is nearly working.

The flags are toggles rather than something you type into the pattern: global, ignore case, multiline, dotall, unicode, and sticky, each with a note on what it changes. There is also a replacement field that previews the result of a substitution, supporting $1 for numbered groups and $<name> for named ones.

This uses your browser's own JavaScript regular expression engine, so what you see here is exactly what your code will do — the same syntax, the same quirks. Nothing is sent anywhere, so the text you are testing against can be real data.

Common questions

Which regex flavour is this?
JavaScript, as implemented by the browser you are using. Most patterns carry over to other languages unchanged, but lookbehind support, named group syntax, and Unicode property escapes differ between engines — test in your target language before relying on the edge cases.
Why does the global flag not change the match list?
The list always scans the whole text, because showing only the first match would make the tool much less useful. The g flag is still honoured where it genuinely matters: in the replacement preview, where it decides whether one occurrence or all of them are replaced.
Can it explain what my pattern means?
Not yet — right now it shows behaviour rather than an explanation. In practice the capture group table answers most questions faster, because you can see precisely which part of the pattern grabbed which text.
My pattern hangs on long input. Why?
Some patterns backtrack catastrophically — nested quantifiers like (a+)+ are the classic case. Match results here are capped so the tab stays responsive, but if a pattern is slow in this page it will be slow in production too, which is worth knowing early.

This page does the work itself, in this tab. Nothing you paste is sent to a server. Close the tab and no copy remains.