Regex Tester

Test a regular expression live, highlight every match, see capture groups and preview a replace — free and private, in your browser.


Flags

Matches
Result after replace


How to use

  1. Type a regular expression in the pattern box and tick the flags you need (g, i, m, s, u).
  2. Paste your text into “Test string” — every match is highlighted live, with the total count above.
  3. 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.