Regex Tester
JavaScript-flavor regex. Matches highlight live as you type. Capture groups expand below.
Matches in context
Matches will appear here.
Try replace mode
After replacement
Replaced output appears here.
Regex cheat sheet
Anchors & boundaries
^start of string (or line, withmflag)$end of string (or line, withmflag)\bword boundary
Character classes
\ddigit,\Dnon-digit\wword char ([A-Za-z0-9_]),\Wnon-word\swhitespace,\Snon-whitespace[abc]any of a/b/c,[^abc]none of.any char (except newline unlesssflag)
Quantifiers
*0+,+1+,?0 or 1{3}exactly 3,{3,5}3 to 5,{3,}3 or more- Add
?for lazy:*?,+?,??
Groups
(abc)capturing group β referenced by$1,$2, β¦(?:abc)non-capturing(?<name>abc)named capture, referenced as$<name>(?=abc)lookahead,(?!abc)negative lookahead(?<=abc)lookbehind,(?<!abc)negative lookbehind
Flags
gglobal (find all matches, not just first)icase-insensitivemmultiline (^and$match line boundaries)sdotall (.matches newlines too)uUnicodeysticky