NexTool
ToolsConvertersBlogAI SuitePricing
HomeCheat SheetsRegular Expression Patterns Cheat Sheet
developer5 sections · 45 items

Regular Expression Patterns Cheat Sheet

Quick reference for regex syntax, character classes, quantifiers, anchors, groups, and common validation patterns. Essential for developers.

Character Classes

ItemValueNotes
.Any character except newline--
\dAny digit (0-9)Same as [0-9]
\DAny non-digit--
\wWord char (a-z, A-Z, 0-9, _)Same as [a-zA-Z0-9_]
\WAny non-word character--
\sWhitespace (space, tab, newline)--
\SAny non-whitespace--
[abc]Any of a, b, or c--
[^abc]Not a, b, or c--
[a-z]Any lowercase letter--

Quantifiers

ItemValueNotes
*0 or moreGreedy
+1 or moreGreedy
?0 or 1 (optional)--
{n}Exactly n times--
{n,}n or more times--
{n,m}Between n and m times--
*?0 or more (lazy)Non-greedy
+?1 or more (lazy)Non-greedy
??0 or 1 (lazy)--

Anchors & Boundaries

ItemValueNotes
^Start of string (or line with m flag)--
$End of string (or line with m flag)--
\bWord boundary--
\BNot a word boundary--
(?=...)Positive lookahead--
(?!...)Negative lookahead--
(?<=...)Positive lookbehind--
(?<!...)Negative lookbehind--

Groups & Flags

ItemValueNotes
(abc)Capturing group--
(?:abc)Non-capturing group--
(?<name>abc)Named capturing group--
a|bAlternation (a or b)--
\1Back-reference to group 1--
g flagGlobal: find all matches--
i flagCase-insensitive matching--
m flagMultiline: ^ and $ match lines--
s flagDotall: . matches newline too--

Common Validation Patterns

ItemValueNotes
Email[\w.-]+@[\w.-]+\.\w{2,}--
URLhttps?://[\w.-]+(?:\.[\w]{2,})(?:/[^\s]*)?--
US Phone\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}--
IP Address (v4)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}--
Date (MM/DD/YYYY)\d{2}/\d{2}/\d{4}--
Hex Color#?[0-9a-fA-F]{3,8}--
US ZIP Code\d{5}(-\d{4})?--
Strong Password(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%]).{8,}--
Slug / URL path[a-z0-9]+(?:-[a-z0-9]+)*--

Tip: Use landscape orientation for wider tables

Related Tools

Regex Tester

Test and debug regular expressions in real-time

JSON Formatter

Format, validate, and beautify JSON data

Slug Generator

Convert text to URL-friendly slugs

Text Statistics Analyzer

Analyze text readability, word frequency, and keyword density

Stay Updated

Get notified about new tools, features, and exclusive deals. No spam, ever.

Browse All Cheat Sheets →
NexTool

Free online tools for developers, writers, and creators. Powered by AI.

Tools

  • Finance & Tax
  • Investment & Retirement
  • Insurance
  • Real Estate
  • Health & Fitness
  • Home & DIY
  • Developer Tools
  • AI Tools
  • All Tools

Resources

  • Blog
  • Unit Conversions
  • All Tools

Company

  • About
  • Pricing
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 NexTool. All rights reserved.

Fine Print Decoder™ and all AI analysis tools are proprietary technology of NexTool.

Made with care for the internet