Regex Tester

Regex Tester Online 🧪

Test JavaScript regular expressions, highlight matches, inspect capture groups and preview replacement output. Paste text, write a pattern and let the regex goblin count the shiny bits.

Pattern And Test Text
🛡️ This regex tester runs locally in your browser. Your pasted text is not uploaded by this tool.
Results And Replace
Matches found
0
Enter a pattern and paste test text.
Capture groups
0
Named groups
0
Pattern flags
gu
Text characters
0
Replacement uses JavaScript regex replacement rules, including $1, $2 and named capture replacement when supported.
Highlighted Matches
Matches will be highlighted here.
Match Report
No regex test has been run yet.
# Match Index Capture groups Named groups
Enter a pattern and test text to see matches.

How do I use the regex tester?

Type a regular expression pattern, paste your test text and choose the flags you need. The tool shows all matches, capture groups, named groups and a highlighted preview.

Should I include slashes around the regex?

No. Enter only the pattern. For example, use \d+ instead of /\d+/g. The global search is applied automatically so every match can be reported.

Can this regex tester show capture groups?

Yes. Numbered capture groups are shown in the match report. Named groups are also shown when your browser supports JavaScript named capture groups.

Can I use this as a regex replace tool?

Yes. Enter replacement text and click Replace to preview the replaced output. JavaScript replacement tokens such as $1 and $<name> can be used.

Does this tool save my text?

No. Regex testing and replacement happen locally in your browser. The tool is made for quick private pattern testing.