Regex Reference
A quick reference for regular expressions. Browse common patterns (email, URL, IP, phone, date) and a cheat sheet for character classes, quantifiers, anchors, and special characters. Click any pattern to copy it.
Common Patterns
Character Classes
Quantifiers
Anchors & Boundaries
Special Characters
Flags
About the Regex Reference
This is a compact, copy-paste-friendly cheat sheet for regular expressions. It covers the most-used patterns for validation (email, URL, IP, phone, date) and the building blocks you need to write your own: character classes, quantifiers, anchors, and escape sequences.
How to use
- Browse the sections — Common Patterns, Character Classes, Quantifiers, Anchors, Special Characters, Flags.
- Click any row to copy the regex to your clipboard.
- Paste into your code, regex tester, or editor.
Frequently asked questions
Which regex flavor is this? The patterns are written for PCRE/JavaScript-style regex, which covers the vast majority of web use cases. Some patterns (like RFC 5322 email) are simplified for readability — adjust strictness to your needs.
Why does my email regex reject valid addresses? Email validation per the full RFC is extremely complex. For most apps, a pragmatic pattern like ^[^@\s]+@[^@\s]+\.[^@\s]+$ is enough; for strict validation, send a verification email.
Are these patterns anchored? Common patterns include ^ and $ anchors so they match the whole string. Remove the anchors if you need to find a match inside a larger text.