Essential Regex Patterns
1. Email Validation
^[^@]+@[^@]+\.[^@]+$
Simple but effective for basic validation.
2. URL Validation
https?://[\w.-]+\.[a-z]{2,}(/[^\s]*)?
Matches http and https URLs.
3. Phone Number (US)
\(\d{3}\)\s?\d{3}-\d{4}
Matches (123) 456-7890 format.
4. Date (YYYY-MM-DD)
\d{4}-\d{2}-\d{2}
Basic ISO date format.
5. IPv4 Address
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
6. Strong Password
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
At least 8 chars, upper, lower, number, special.
7. Hex Color
^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$
8. Username
^[a-zA-Z0-9_]{3,16}$
3-16 chars, alphanumeric + underscore.
9. Zip Code (US)
\d{5}(-\d{4})?
10. Time (HH:MM)
^([01]?\d|2[0-3]):[0-5]\d$
Test all these patterns in our Regex Tester!