WebTools
WebTools

Free online tools for developers, designers, and everyday users. 100+ tools, no signup required.

Popular Tools

  • JSON Formatter
  • Base64 Codec
  • QR Code
  • Compress
  • Text Diff

Resources

  • About Us
  • Blog
  • Settings

More Tools

  • APIPulse
  • CodeJet
  • PeerBeam

Legal

  • Privacy Policy
© 2026 WebTools. All rights reserved.
DeveloperRegex Cheat Sheet

Regex Cheat Sheet

A comprehensive, well-organized regex cheat sheet that covers everything from basic metacharacters to advanced lookarounds. Whether you are a beginner learning regex or an experienced developer needing a quick reference, this guide puts the most important patterns and syntax at your fingertips.

Regex
46 items
.Match any character except newline
\dMatch digit [0-9]
\DMatch non-digit [^0-9]
\wMatch word character [a-zA-Z0-9_]
\WMatch non-word character
\sMatch whitespace character
\SMatch non-whitespace character
\bMatch word boundary
\BMatch non-word boundary
[abc]Match any one character in brackets
[^abc]Match any character not in brackets
[a-z]Match characters in the specified range
^Match start of string
$Match end of string
*Match previous item 0 or more times
+Match previous item 1 or more times
?Match previous item 0 or 1 time
{n}Match previous item exactly n times
{n,}Match previous item at least n times
{n,m}Match previous item n to m times
()Capturing group
(?:)Non-capturing group
(?=)Positive lookahead
(?!)Negative lookahead
(?<=)Positive lookbehind
(?<!)Negative lookbehind
|Alternation (OR)
\Escape special character
^[a-zA-Z0-9]+$Alphanumeric combination
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$Email address
^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([\/\w .-]*)*\/?$URL address
^1[3-9]\d{9}$Chinese mobile number
^\d{4}[-/]\d{1,2}[-/]\d{1,2}$Date format YYYY-MM-DD
^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$IP address (simple)
^[\u4e00-\u9fa5]+$Chinese characters only
^[\u4e00-\u9fa5a-zA-Z0-9]+$Chinese + letters + numbers
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^\s]{8,}$Strong password (upper+lower+digits, 8+)
^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$HEX color value
<[^>]+>HTML tag
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\bIP address (exact)
/^(0|[1-9]\d*)(\.\d+)?$/Number (integer or decimal)
iCase insensitive
gGlobal match
mMultiline mode
sDot matches newline
uUnicode mode

Regex Cheat Sheet Guide

Character Classes: Match specific types of characters like digits, letters, whitespace, etc.

Quantifiers: Control match repetition with *, +, ? and {n,m}.

Common Patterns: Predefined regex patterns for email, URL, phone number, etc.

Click to CopyCategory Filter

Regex Cheat Sheet & Quick Reference

A comprehensive, well-organized regex cheat sheet that covers everything from basic metacharacters to advanced lookarounds. Whether you are a beginner learning regex or an experienced developer needing a quick reference, this guide puts the most important patterns and syntax at your fingertips.

  • Covers all essential regex metacharacters, anchors, and escape sequences
  • Organized sections for character classes, quantifiers, groups, and assertions
  • Includes common regex patterns for emails, URLs, dates, and more
  • One-click copy for every pattern and expression
  • Highlights differences between regex flavors where applicable
  • Searchable — jump to any token or concept instantly
  • Works offline once loaded — no internet needed after first visit

How to Use the Regex Cheat Sheet

  1. 1

    Browse by category

    Navigate through sections like Character Classes, Quantifiers, Groups, and Assertions to find the syntax you need.

  2. 2

    Search for a token

    Use the search bar to quickly find a specific regex token or concept by name or symbol.

  3. 3

    Copy a pattern

    Click the copy button next to any pattern or expression to copy it to your clipboard.

  4. 4

    Try it live

    Use the linked Regex Visualizer tool to test and debug any pattern in real time.

Frequently Asked Questions

Related Tools

Regex Visualizer & DebuggerText Find & ReplaceJSONPath Query TesterText Diff ToolCode Screenshot Generator