Regex Generator
Browse and copy common regex patterns for emails, URLs, dates, and more.
Email Address
Matches standard email addresses
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}URL
Matches HTTP/HTTPS URLs
https?://[\w.-]+(?:\.[a-zA-Z]{2,})(?:/[\w./?%&=-]*)?IPv4 Address
Matches valid IPv4 addresses
(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)Phone Number (US)
Matches US phone numbers in various formats
(?:\+1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}Date (YYYY-MM-DD)
Matches ISO date format
\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])Date (MM/DD/YYYY)
Matches US date format
(?:0[1-9]|1[0-2])/(?:0[1-9]|[12]\d|3[01])/\d{4}Time (24h)
Matches 24-hour time
(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?Hex Color
Matches 3 or 6 digit hex colors
#(?:[0-9a-fA-F]{3}){1,2}HTML Tag
Matches opening HTML tags
<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>Integer
Matches positive and negative integers
-?\d+Decimal Number
Matches decimal numbers
-?\d+\.\d+Username
3-16 chars: letters, numbers, underscore, hyphen
[a-zA-Z0-9_-]{3,16}Strong Password
Min 8 chars, upper, lower, digit, special
(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}ZIP Code (US)
Matches 5-digit or ZIP+4 codes
\d{5}(?:-\d{4})?SSN
Matches US Social Security Number format
\d{3}-\d{2}-\d{4}Credit Card
Matches 16-digit card numbers
\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}Slug
Matches URL-friendly slugs
[a-z0-9]+(?:-[a-z0-9]+)*UUID
Matches UUID v4 format
[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}