Regex Cheat Sheet
Searchable reference for regular expression syntax.
This tool runs entirely in your browser. Nothing you type is uploaded, logged or stored, which makes it safe for keys, tokens and other sensitive values.
What Is Regex Cheat Sheet?
This Regex Cheat Sheet is a searchable reference for regular expression syntax. It covers the core tokens used across most regex engines: literal characters, character classes, quantifiers, anchors, groups, alternation, lookarounds, escapes, and flags, plus common examples.
Use it as a quick lookup while building or reviewing patterns. Each entry shows the syntax and a short description of what it matches. Search to filter the reference as you type.
Regex syntax varies slightly between engines. This sheet focuses on the common core supported by JavaScript and most modern engines.
How to Use Regex Cheat Sheet
- Use the search field to filter the reference by keyword.
- Browse the sections for literal characters, character classes, quantifiers, anchors, groups, alternation, lookarounds, escapes, and flags.
- Copy any token you need into your pattern.
- Combine tokens and test the result in the Regex Tester.
Features
- Searchable syntax reference that filters as you type.
- Organized sections for each major category of regex syntax.
- Common examples for everyday matching tasks.
- Copy-friendly tokens for direct use in patterns.
- Fully client-side — no queries are uploaded.
Common Use Cases
- Looking up a forgotten token while writing a pattern.
- Learning the core regex syntax in a structured reference.
- Comparing related tokens such as greedy and lazy quantifiers.
- Finding the right anchor or lookaround for a matching task.
How It Works
The cheat sheet is a structured list of regex tokens grouped by category. The search field filters the visible entries in real time so you can quickly find the syntax you need.
Each entry pairs the token with a plain-language description. Together, the entries cover the common core of regex syntax: literals, character classes and negated classes, greedy and lazy quantifiers, anchors, capturing and non-capturing groups, alternation, lookahead and lookbehind, escapes, and flags.
Security and Privacy Considerations
A syntax reference does not make patterns safe. Patterns with nested quantifiers can cause ReDoS, and regex is not a substitute for a proper parser on complex input. Apply the same care as when writing patterns by hand.
All lookups are local, so nothing leaves your browser.
When to Use Regex Cheat Sheet
- Looking up a forgotten token while writing or reviewing a pattern.
- Learning the core regex syntax in a structured, searchable reference.
- Comparing related tokens such as greedy and lazy quantifiers.
- Finding the right anchor or lookaround for a matching task.
When Not to Use Regex Cheat Sheet
- As a guarantee that a pattern is safe — a syntax reference does not protect against ReDoS or misuse.
- As a substitute for testing patterns against real input.
- For engine-specific features outside the common core, which may differ across engines.
Comparison
- Regex cheat sheet vs regex tester: the cheat sheet is a syntax reference; the tester runs patterns against text. Use the cheat sheet to look up tokens and the tester to verify the resulting pattern.
- Regex cheat sheet vs regex explainer: the cheat sheet lists tokens by category; the explainer walks through a specific pattern token by token. Use the cheat sheet for lookup and the explainer for understanding a complete pattern.
Frequently Asked Questions
- Does this cheat sheet cover every regex engine?
- It covers the common core supported by JavaScript and most modern engines. Some engines add features or use slightly different syntax for advanced constructs.
- Can I search the reference?
- Yes. The search field filters entries as you type so you can quickly find a token.
- What is the difference between greedy and lazy quantifiers?
- A greedy quantifier matches as much as possible; a lazy quantifier (with a trailing ?) matches as little as possible. The sheet lists both.
- Is my search uploaded?
- No. Filtering happens entirely in your browser.