Regular Expression Tester

Regex Cheat Sheet

. - Any character except newline
\w - Word character
\d - Digit
\s - Whitespace character
[abc] - Any of a, b, or c
[^abc] - Not a, b, or c
^abc - Start of string
abc$ - End of string
(abc) - Capture group
a* - 0 or more
a+ - 1 or more
a? - 0 or 1
a{3} - Exactly 3
a{3,} - 3 or more
a{3,6} - Between 3 and 6
      

Replacement Syntax

$$ - Inserts a $ character
$&, $0 - Inserts the matched substring
$` - Inserts the string preceding the matched substring
$' - Inserts the string following the matched substring
$n, $nn - Inserts backreference n/nn (capturing group)
${n} - Inserts backreference n (capturing group)