Regex Tester
Test a regular expression live, highlight every match, see capture groups and preview a replace — free and private, in your browser.
Matches
Capture groups (first match)
Result after replace
How to use
- Type a regular expression in the pattern box and tick the flags you need (g, i, m, s, u).
- Paste your text into “Test string” — every match is highlighted live, with the total count above.
- Add a replacement to preview the result, and check the capture groups from the first match below.
FAQ
Is my pattern or text sent to a server?
No. The expression is run with your browser’s own JavaScript engine and your text never leaves the page. It works offline and keeps everything private — safe for logs, code or anything sensitive.
What do the flags do?
g finds every match instead of just the first, i ignores letter case, m makes ^ and $ match at each line, s lets the dot match newlines, and u turns on full Unicode handling. Tick the ones your pattern needs.
How do I use capture groups in the replacement?
Wrap parts of your pattern in parentheses to capture them, then refer to them in the replacement with $1, $2 and so on. Use $& to insert the whole match. The replacement preview updates as you type.