abc…
Letters
123…
Digits
\d
Any digit
\D
Any non Digit character
.
Any character
.
Period
[abc]
Only a, b, or c
[^abc]
Not a, b, nor c
[a-z]
Characters a to z
[0-9]
Numbers zero to 9
\w
Any alphanumeric character. So a letter or a number. Anything that isn’t a symbol or punctuation
W means word
\W
Any non alpha numeric character (symbols, punctuation, etc)
{m}
M repetitions
{m,n}
M to n repetitions
*
Zero or more repetitions
+
One or more repetitions
?
Optional character
\s
Any whitespace
\S
Any non whitespace character
^…$
Starts and ends
(…)
Capture group
(a(b,c))
Capture sub group
(.*)
Capture all
(abc|def)
Matched abc or def