Regex Cheat Sheet
Interactive quick-reference guide for RegEx tokens, character classes, anchors, quantifiers, and syntax.
RegEx Syntax Reference
Comprehensive catalog of regular expression tokens, character sets, anchors, and quantifiers.
Character Classes
7 tokensMatches any decimal digit [0-9]
Item 7Match: 7Matches any character that is not a digit
Item 7Match: Item Matches alphanumeric characters plus underscore [a-zA-Z0-9_]
user_1Match: user_1Matches any non-alphanumeric character
hi!Match: !Matches space, tab, newline, or form feed
a bMatch: Matches any character except spaces/tabs/newlines
a bMatch: aMatches any single character except newline (unless dotAll flag 's' is set)
catMatch: cAnchors & Boundaries
4 tokensMatches position at start of input (or line in multiline mode)
hello worldMatch: hMatches position at end of input (or line in multiline mode)
hello worldMatch: dMatches position between a word character and a non-word character
cat dogMatch: catMatches position where word boundary does NOT occur
catMatch: atQuantifiers
7 tokensMatches 0 or more occurrences of preceding element
goooalMatch: goooMatches 1 or more occurrences of preceding element
goooalMatch: goooMatches 0 or 1 occurrence of preceding element
colorMatch: colorMatches exactly N repetitions of preceding element
1000Match: 100Matches at least N repetitions of preceding element
10000Match: 10000Matches between N and M repetitions inclusive
10000Match: 1000Matches as few characters as possible (non-greedy)
<div>text</div>Match: <div>Groups & Ranges
6 tokensMatches any single character listed inside brackets
catMatch: cMatches any single character NOT listed inside brackets
catMatch: tMatches any character in specified ASCII range
Code9Match: oGroups sub-expressions together and remembers the matched text
ha haMatch: haGroups sub-expressions without creating a back-reference
ha haMatch: haMatches either the expression on the left or the right
cat dogMatch: catAssertions & Lookarounds
4 tokensAsserts that the preceding pattern is followed by specified sub-pattern
100$Match: 100Asserts that the preceding pattern is NOT followed by specified sub-pattern
100%Match: 100Asserts that specified sub-pattern precedes current position
$100Match: 100Asserts that specified sub-pattern does NOT precede current position
€100Match: 100Regex Flags
5 tokensFinds all matches rather than stopping after the first match
a a aMatch: All 'a'sMakes match evaluation ignore uppercase/lowercase distinction
Cat CATMatch: Both matchesCauses ^ and $ anchors to match start and end of individual lines
line1
line2Match: Per lineAllows the dot (.) wildcard to match newline characters
a
bMatch: Matches entire stringEnables full Unicode pattern matching support
😀Match: Matches emojiFast Regular Expression Syntax Reference
Regular expressions (RegEx) are essential tools for string parsing, pattern matching, and data validation. However, memorizing every character class, quantifier, anchor, and lookaround syntax can be challenging during daily development.
The Regex Cheat Sheet provides an instant, searchable syntax reference guide. Developers can quickly look up specific token definitions, inspect concrete matching examples, and copy exact regex symbols directly into their code editors.
Core Tool Capabilities
- Categorized Token Catalog: Browse structured categories including character classes, quantifiers, anchors, assertions, and flags.
- Instant Token Search: Filter regex syntax by token symbols, token names, or functional descriptions.
- Concrete Match Examples: Inspect live pattern examples demonstrating target matches for each token.
- One-Click Copy: Copy individual regex tokens directly to your clipboard for instant code insertion.
Local Browser Privacy
Your files are processed locally on your device. Files are not uploaded, transmitted, or stored on remote servers.
Once the page has loaded, you can disconnect your network connection and continue using this tool offline.
Target Use Cases
- • Daily Development Lookup
- • RegEx Learning & Onboarding
- • Code Syntax Verification
- • Bookmarklet & Script Authoring
Technical Specifications & Platform Limits
Covers universally supported regular expression syntax
Character Classes, Anchors, Quantifiers, Groups, Assertions, Flags
Instant sub-millisecond keyword lookup across all tokens
No external network requests or logging
Step-by-Step Workflow
Select Syntax Category
Filter tokens by specific categories such as Character Classes, Anchors, or Quantifiers.
Search Specific Tokens
Type a character code, symbol, or descriptive keyword into the search bar.
Inspect Examples
Review sample strings and highlighted target matches for each regex syntax token.
Copy Regex Syntax
Click the copy button next to any token symbol to copy it to your clipboard.
Practical Real-World Use Cases
Daily Development Lookup
Developers quickly verify token syntax without leaving your browser or workflow.
RegEx Learning & Onboarding
Developers understand complex lookaround and quantifier behaviors through clear descriptions.
Code Syntax Verification
Developers check exact escape characters and boundary anchors before writing complex validation logic.
Bookmarklet & Script Authoring
Developers reference regex flags and group expressions while building quick client-side scripts.
Frequently Asked Questions
- Which regular expression dialect does this cheat sheet target?
- This cheat sheet targets the standard ECMAScript (JavaScript) regular expression specification, which is broadly compatible with Python, Java, PHP, and modern Web APIs.
- What is the difference between greedy and lazy quantifiers?
- Greedy quantifiers (like * and +) match as much text as possible, whereas lazy quantifiers (like *? and +?) match as little text as possible to satisfy the pattern.
- How do lookahead and lookbehind assertions work?
- Lookaround assertions check if a sub-pattern precedes or follows the current position without including that matched text in the final regular expression result.
- Does this cheat sheet require an internet connection?
- No. The entire cheat sheet catalog and search engine execute completely within your web browser.
- Is my search data or query sent to a server?
- No. All search filtering and token rendering happen locally inside your browser without transmitting any data.
Share this tool
Help others discover this utility. No login or registration required.
Master this tool with Guides & Articles
Learn the workflows, common mistakes, and advanced techniques behind Regex Cheat Sheet with our deep-dive educational content.
Building a Custom Developer Toolbox with Browser Utilities
A practical guide to assembling browser-native developer workflows for formatting, validation, URL checks, payload preparation, security review, and deployment preflight.
Identifying CSS Bloat in Modern UI Components
A frontend workflow guide to finding CSS bloat, reducing unused styles, controlling Tailwind utility growth, and keeping component systems maintainable.
Cleaning Messy JSON for API Performance and Reliability
A developer workflow guide to JSON cleanup, validation, schema alignment, payload size, and debugging API data before production handoff.