Regex Cheatsheet
Quick reference for regular expression syntax — character classes, anchors, quantifiers, groups, lookaheads/lookbehinds, flags, and common patterns (email, URL, IPv4, hex color, date, phone, password). Search or filter by category.
Input
Output
| Pattern | Description | Example | Category |
|---|---|---|---|
| No data yet | |||
Guides
What this tool does
This is a quick reference for regular expression syntax: character classes, anchors, quantifiers, groups, lookaheads/lookbehinds, flags, and a handful of ready-to-use common patterns (email, URL, IPv4 address, hex color, date, phone number, strong password). Each entry shows the syntax, a plain-English description, and a worked example, so you don't have to remember whether \b or \B means "word boundary," or whether (?=) is a lookahead or a lookbehind.
It is a lookup table, not a live regex engine — it does not compile or test a pattern against your text. To build and test a pattern against real input with live match highlighting, use the companion Regex Tester; to convert a pattern between regex flavors, use Regex Converter; to get a plain-English explanation of a specific pattern you already have, use the Regex Explainer. This tool exists purely to answer "what does this syntax mean" and "what's the pattern for X."
How to use it
Type into the search box to filter by pattern, description, or example — searching lookahead narrows the table to the two lookahead rows, and searching email jumps straight to the email pattern. Use the Category dropdown to browse one section at a time (Anchors, Character Classes, Quantifiers, Groups & References, Lookahead & Lookbehind, Flags, Common Patterns) instead of scrolling the full list. Leave both empty to see every entry. Use the copy button on any row, or the table's download button, to export what you're looking at as CSV.
What's the difference between \d, \w, and \s?
The three most common character classes. \d matches a single digit (0-9); \w matches a "word character" — letters, digits, and underscore; \s matches whitespace (space, tab, newline). Their uppercase counterparts (\D, \W, \S) negate each — "not a digit," "not a word character," and so on.
Capturing group vs. non-capturing group?
(abc) is a capturing group: whatever it matches is saved and can be referenced later (as \1, or by name with (?<name>abc) / \k<name>). (?:abc) groups a sub-pattern for a quantifier or alternation without saving the match — useful when you need grouping but not extraction.
Lookahead vs. lookbehind?
Both are zero-width assertions — they check for a pattern without consuming characters. A lookahead, (?=abc) / (?!abc), checks what comes after the current position ("match this word only if ing follows"). A lookbehind, (?<=abc) / (?<!abc), checks what comes before it ("match this number only if preceded by $"). The ! variants are negative.
Do regex flags work the same everywhere?
Mostly, not identically. g, i, and m are near-universal across JavaScript, Python, and PCRE. s (dotall) and u (unicode) are JS/PCRE conventions — other languages enable the same behavior differently (Python's re.DOTALL). Check your language's docs before assuming a flag ports directly.
Is my search sent anywhere?
No. The pattern table ships with the page and filtering happens entirely in your browser — nothing you type is uploaded or stored.