Character Classes
.

Any character except newline

\d

Digit (0-9)

\D

Not a digit

\w

Word character (a-z, A-Z, 0-9, _)

\W

Not a word character

\s

Whitespace (space, tab, newline)

\S

Not whitespace

[abc]

Any of a, b, or c

[^abc]

Not a, b, or c

[a-z]

Character range

Anchors
^

Start of string

$

End of string

\b

Word boundary

\B

Not word boundary

Quantifiers
*

0 or more

+

1 or more

?

0 or 1

{n}

Exactly n times

{n,}

n or more times

{n,m}

Between n and m times

Groups
(abc)

Capture group

(?:abc)

Non-capturing group

(?<name>abc)

Named capture group

\1

Backreference to group 1

Alternation
a|b

a or b

Flags
g

Global - find all matches

i

Case insensitive

m

Multiline

s

Dot matches newline

u

Unicode

y

Sticky