TEST STRING
0 matches
RESULTS
Matches
Capture Groups
Code Generation
Reference
| Syntax | Description |
|---|---|
| Characters | |
| . | Any character (except newline) |
| \d | Digit [0-9] |
| \D | Non-digit |
| \w | Word character [a-zA-Z0-9_] |
| \W | Non-word character |
| \s | Whitespace |
| \S | Non-whitespace |
| \b | Word boundary |
| Quantifiers | |
| * | 0 or more |
| + | 1 or more |
| ? | 0 or 1 (optional) |
| {n} | Exactly n |
| {n,m} | Between n and m |
| *? +? ?? | Non-greedy versions |
| Character Classes | |
| [abc] | Any of a, b, or c |
| [^abc] | Not a, b, or c |
| [a-z] | Range a to z |
| Anchors | |
| ^ | Start of string/line |
| $ | End of string/line |
| Groups & Alternation | |
| (abc) | Capture group |
| (?<name>abc) | Named capture group |
| (?:abc) | Non-capturing group |
| a|b | a or b |
| \1 | Backreference to group 1 |
| Lookaround | |
| (?=abc) | Positive lookahead |
| (?!abc) | Negative lookahead |
| (?<=abc) | Positive lookbehind |
| (?<!abc) | Negative lookbehind |
| Flags | |
| g | Global — find all matches |
| i | Case insensitive |
| m | Multiline — ^ and $ match line boundaries |
| s | DotAll — . matches newlines |
| u | Unicode support |