RegexLab

Test regular expressions with live highlighting and capture groups.

Runs entirely in your browser — safe for patterns over sensitive data

Expression

0 matches
/ /
gimsu
Presets:

Test string

Highlighted

Replace (optional — use $1, $2 for groups)

Matches

Cheat sheet

. any char
\d digit
\w word char
\s whitespace
\b word boundary
^ line start
$ line end
[abc] char set
[^abc] negated set
a* 0 or more
a+ 1 or more
a? optional
a{2,4} 2–4 times
(x) capture group
(?:x) non-capturing
(?<n>x) named group
a|b alternation
(?=x) lookahead
(?!x) neg. lookahead
(?<=x) lookbehind
*? lazy quantifier