Regex Tester
Test and debug regular expressions with real-time matching
//g
Enter test string to see matches
Common Patterns
Basic email validation
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g
Phone
International phone numbers
/\+?\d{1,4}?[-\s]?\(?\d{1,3}\)?[-\s]?\d{1,4}[-\s]?\d{1,9}/g
URL
HTTP/HTTPS URLs
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g
IPv4
IPv4 addresses
/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g
Date
YYYY-MM-DD format
/\d{4}-\d{2}-\d{2}/g
Hex Color
Hex color codes
/#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}/g
Quick Reference
Character Classes
\d
- Digits (0-9)\w
- Word characters\s
- Whitespace.
- Any characterQuantifiers
*
- Zero or more+
- One or more?
- Zero or one{n,m}
- Between n and mAnchors
^
- Start of string$
- End of string\b
- Word boundary\B
- Non-word boundary