Regex Cheatsheet
Common regular-expression tokens and patterns with readable explanations. Use the search field to quickly narrow this reference.
| Value | Name / form | Meaning |
|---|---|---|
| . | Any character | Matches one character except a line break by default. |
| \d | Digit | Matches 0 through 9. |
| \w | Word character | Matches letters, digits, and underscore. |
| \s | Whitespace | Matches spaces, tabs, and line breaks. |
| ^ / $ | Anchors | Match the beginning or end of input. |
| * / + / ? | Quantifiers | Match zero or more, one or more, or zero or one. |
| {n,m} | Range | Match between n and m repetitions. |
| [abc] | Character class | Match one listed character. |
| [^abc] | Negated class | Match a character not in the list. |
| (abc) | Capture group | Group and capture the matched substring. |
| (?:abc) | Non-capturing group | Group without creating a capture. |
| a|b | Alternation | Match a or b. |
How to use this reference
Search by a value, name, or keyword. The table is designed as a quick reminder while you code, debug, or review documentation. Examples are intentionally compact; verify environment-specific behavior in the official documentation for the platform you are using.