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-whitespaceQuantifiers
* 0 or more+ 1 or more? 0 or 1 (optional){3} Exactly 3{3,} 3 or more{3,5} Between 3 and 5Anchors
^ Start of string$ End of string\b Word boundaryGroups & Lookaround
(abc) Capturing group(?:abc) Non-capturing group(?=abc) Positive lookahead(?!abc) Negative lookahead(?<=abc) Positive lookbehind(?<!abc) Negative lookbehindCommon Patterns
Email Basic email validationURL HTTP/HTTPS URLDate YYYY-MM-DD formatPhone E.164 phone numberHex Color #RGB or #RRGGBBPassword Min 8, upper, lower, digitFlags
g Global - find all matchesi Case insensitivem Multiline - ^ and $ match line endss Dotall - . matches newlinesCopied to clipboard!