Regex Tester
Build and test regular expressions against your own text in real time. See every match highlighted, inspect capture groups, and preview replacements — all in your browser.
/
/g
Flags
Tip: enable the g flag to replace every match instead of only the first.
How to use Regex Tester
- 1
Write your pattern
Type a regular expression in the pattern field, then toggle the flag chips (g, i, m, and more) to control exactly how matching works.
- 2
Add your test text
Paste the text you want to search into the “Test string” box. Matches are highlighted instantly as you type or edit the pattern.
- 3
Inspect the matches
Review each match, its position in the text, and any capture or named groups in the results list to confirm the pattern behaves as expected.
- 4
Replace or copy
Enter a replacement to preview substitutions with $1-style backreferences, then copy the result straight into your code or document.
Frequently asked questions
What is a regular expression?
Which regex flavor does this tester use?
What do the flags mean?
How do capture groups work?
Is my data sent to a server?
Related tools
Keep going with these handy tools