Test regular expressions live with match highlighting, capture group display, replace mode, and flag toggles. Browser-native JavaScript regex engine — instant results.
Click any pattern to paste it into the regex box →
Type your regex in the pattern box. Toggle flags (g, i, m, s) as needed.
Paste the text you want to test the pattern against — results update live.
See matches highlighted, with capture groups, positions, and replace output.
Yes — 100% free, no login, no limits.
This tool uses the JavaScript RegExp engine natively built into your browser. JavaScript regex is ECMAScript-compliant and supports most common patterns — character classes, quantifiers, anchors, groups, lookaheads/lookbehinds, and Unicode. It does not support POSIX classes or lookbehinds in older browsers.
g (global) — find ALL matches, not just the first.
i (case-insensitive) — treat uppercase and lowercase as equal.
m (multiline) — ^ and $ match start/end of each LINE, not just the whole string.
s (dotAll) — . matches newline characters too.
In the Replace field, use $1, $2, etc. to reference capture groups from your pattern. For example, with pattern (\w+) (\w+) and replacement $2 $1, "John Smith" becomes "Smith John". Use $& to insert the full matched text.