Characters
| . | Any character (except newline unless s flag) |
| \d \D | Digit / Non-digit |
| \w \W | Word char [a-zA-Z0-9_] / Non-word |
| \s \S | Whitespace / Non-whitespace |
| \b \B | Word boundary / Non-boundary |
Quantifiers
| * + ? | 0+, 1+, 0 or 1 (greedy) |
| *? +? ?? | Lazy versions |
| {n} {n,} {n,m} | Exactly n, n+, between n and m |
Groups & Lookaround
| (abc) | Capture group |
| (?:abc) | Non-capturing group |
| (?<name>abc) | Named group |
| (?=abc) | Positive lookahead |
| (?!abc) | Negative lookahead |
| (?<=abc) | Positive lookbehind |
| (?<!abc) | Negative lookbehind |
Flags
| g | Global — find all matches |
| i | Case insensitive |
| m | Multiline — ^ $ match line start/end |
| s | Dotall — . matches newline |