Regex tester

JavaScript regular expressions, tested live in your browser. Nothing is sent.

//
Flags

Matches

Capture groups

Replace

Cheat sheet
.any character (not newline unless s)\d \w \sdigit, word char, whitespace (capital = opposite)
^ $start / end of input (line with m)\bword boundary
[abc] [^abc]one of / none of[a-z]range
* + ?0+, 1+, 0 or 1 (add ? for lazy){2,4}between 2 and 4 times
(x)capture group(?:x)non-capturing group
(?<n>x)named groupa|ba or b
(?=x) (?!x)lookahead, negative(?<=x) (?<!x)lookbehind, negative
\1 \k<n>backreference\. \\ \/escape a special character