100% Private

Regex Cheatsheet - Quick Reference Guide

Quick reference for regular expression syntax. Search patterns, character classes, quantifiers, anchors. Copy examples instantly.

Character Classes

. Any character except newline
\w Word character [a-zA-Z0-9_]
\d Digit [0-9]
\s Whitespace [ \t\n\r]
\W Non-word character
\D Non-digit
\S Non-whitespace

Quantifiers

* 0 or more
+ 1 or more
? 0 or 1 (optional)
{3} Exactly 3
{3,} 3 or more
{3,5} Between 3 and 5

Anchors

^ Start of string
$ End of string
\b Word boundary

Groups & Lookaround

(abc) Capturing group
(?:abc) Non-capturing group
(?=abc) Positive lookahead
(?!abc) Negative lookahead
(?<=abc) Positive lookbehind
(?<!abc) Negative lookbehind

Common Patterns

Email Basic email validation
URL HTTP/HTTPS URL
Date YYYY-MM-DD format
Phone E.164 phone number
Hex Color #RGB or #RRGGBB
Password Min 8, upper, lower, digit

Flags

g Global - find all matches
i Case insensitive
m Multiline - ^ and $ match line ends
s Dotall - . matches newlines
Copied to clipboard!

Related Tools

View all Regex validators →

Privacy Notice: This site works entirely in your browser. We don't collect or store your data. Optional analytics help us improve the site. You can deny without affecting functionality.