DEV/REF
Regex Cheatsheet
Searchable reference for regex tokens, quantifiers, groups, lookarounds, and flags.
Character classes
| . | Any char except newline |
| \d | Digit [0-9] |
| \D | Non-digit |
| \w | Word char [A-Za-z0-9_] |
| \W | Non-word char |
| \s | Whitespace |
| \S | Non-whitespace |
| [abc] | Any of a, b, c |
| [^abc] | None of a, b, c |
| [a-z] | Range a to z |
Anchors
| ^ | Start of string / line |
| $ | End of string / line |
| \b | Word boundary |
| \B | Non-word boundary |
Quantifiers
| * | 0 or more |
| + | 1 or more |
| ? | 0 or 1 |
| {n} | Exactly n |
| {n,} | n or more |
| {n,m} | Between n and m |
| *? | Lazy 0 or more |
Groups
| (abc) | Capture group |
| (?:abc) | Non-capturing group |
| (?<name>abc) | Named group |
| a|b | a or b |
| \1 | Backreference to group 1 |
Lookarounds
| (?=abc) | Positive lookahead |
| (?!abc) | Negative lookahead |
| (?<=abc) | Positive lookbehind |
| (?<!abc) | Negative lookbehind |
Flags
| g | Global |
| i | Case-insensitive |
| m | Multiline |
| s | Dotall |
| u | Unicode |
| y | Sticky |
Related tools
All →DEV/FORMAT
JSON Formatter
Prettify, minify, and validate JSON data strings instantly.
DEV/SQL
SQL Editor & Checker
Format SQL and lint for missing WHERE, unmatched quotes, and common mistakes.
DEV/AUTH
JWT Debugger
Decode and inspect JSON Web Token headers and payloads.
DEV/SCHED
Cron Editor
Build and explain crontab expressions.