Skip to main content
DEVELOPER UTILITY
📖

Regex Cheat Sheet

Interactive quick-reference guide for RegEx tokens, character classes, anchors, quantifiers, and syntax.

✓100% Client-Side Interactive Reference
✓Zero External API Dependencies or Tracking
✓Instant Copy & Filterable RegEx Tokens

RegEx Syntax Reference

Comprehensive catalog of regular expression tokens, character sets, anchors, and quantifiers.

Search & Quick Copy

Character Classes

7 tokens
Digit
\d

Matches any decimal digit [0-9]

Example: Item 7Match: 7
Non-digit
\D

Matches any character that is not a digit

Example: Item 7Match: Item
Word Character
\w

Matches alphanumeric characters plus underscore [a-zA-Z0-9_]

Example: user_1Match: user_1
Non-word Character
\W

Matches any non-alphanumeric character

Example: hi!Match: !
Whitespace
\s

Matches space, tab, newline, or form feed

Example: a bMatch:
Non-whitespace
\S

Matches any character except spaces/tabs/newlines

Example: a bMatch: a
Any Character
.

Matches any single character except newline (unless dotAll flag 's' is set)

Example: catMatch: c

Anchors & Boundaries

4 tokens
Start of String / Line
^

Matches position at start of input (or line in multiline mode)

Example: hello worldMatch: h
End of String / Line
$

Matches position at end of input (or line in multiline mode)

Example: hello worldMatch: d
Word Boundary
\b

Matches position between a word character and a non-word character

Example: cat dogMatch: cat
Non-word Boundary
\B

Matches position where word boundary does NOT occur

Example: catMatch: at

Quantifiers

7 tokens
Zero or More (Greedy)
*

Matches 0 or more occurrences of preceding element

Example: goooalMatch: gooo
One or More (Greedy)
+

Matches 1 or more occurrences of preceding element

Example: goooalMatch: gooo
Optional (0 or 1)
?

Matches 0 or 1 occurrence of preceding element

Example: colorMatch: color
Exactly N Times
{n}

Matches exactly N repetitions of preceding element

Example: 1000Match: 100
N or More Times
{n,}

Matches at least N repetitions of preceding element

Example: 10000Match: 10000
Between N and M Times
{n,m}

Matches between N and M repetitions inclusive

Example: 10000Match: 1000
Lazy Quantifier
*?

Matches as few characters as possible (non-greedy)

Example: <div>text</div>Match: <div>

Groups & Ranges

6 tokens
Character Set
[abc]

Matches any single character listed inside brackets

Example: catMatch: c
Negated Character Set
[^abc]

Matches any single character NOT listed inside brackets

Example: catMatch: t
Character Range
[a-z]

Matches any character in specified ASCII range

Example: Code9Match: o
Capturing Group
(...)

Groups sub-expressions together and remembers the matched text

Example: ha haMatch: ha
Non-Capturing Group
(?:...)

Groups sub-expressions without creating a back-reference

Example: ha haMatch: ha
OR / Alternation
a|b

Matches either the expression on the left or the right

Example: cat dogMatch: cat

Assertions & Lookarounds

4 tokens
Positive Lookahead
(?=...)

Asserts that the preceding pattern is followed by specified sub-pattern

Example: 100$Match: 100
Negative Lookahead
(?!...)

Asserts that the preceding pattern is NOT followed by specified sub-pattern

Example: 100%Match: 100
Positive Lookbehind
(?<=...)

Asserts that specified sub-pattern precedes current position

Example: $100Match: 100
Negative Lookbehind
(?<!...)

Asserts that specified sub-pattern does NOT precede current position

Example: €100Match: 100

Regex Flags

5 tokens
Global Match
g

Finds all matches rather than stopping after the first match

Example: a a aMatch: All 'a's
Case Insensitive
i

Makes match evaluation ignore uppercase/lowercase distinction

Example: Cat CATMatch: Both matches
Multiline Mode
m

Causes ^ and $ anchors to match start and end of individual lines

Example: line1 line2Match: Per line
Dotall Mode
s

Allows the dot (.) wildcard to match newline characters

Example: a bMatch: Matches entire string
Unicode Mode
u

Enables full Unicode pattern matching support

Example: 😀Match: Matches emoji

Fast 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

Regex Flavor
ECMAScript / JavaScript Standard

Covers universally supported regular expression syntax

Supported Categories
6 Core Syntax Clusters

Character Classes, Anchors, Quantifiers, Groups, Assertions, Flags

Search Mechanism
Real-Time Client-Side Filtering

Instant sub-millisecond keyword lookup across all tokens

Client Privacy
Full In-Browser Execution

No external network requests or logging

Step-by-Step Workflow

1

Select Syntax Category

Filter tokens by specific categories such as Character Classes, Anchors, or Quantifiers.

2

Search Specific Tokens

Type a character code, symbol, or descriptive keyword into the search bar.

3

Inspect Examples

Review sample strings and highlighted target matches for each regex syntax token.

4

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.