Regex Generator
Generate regular expressions from common patterns
Showing 21 of 21 patterns
Email Address
Matches standard email addresses
Email (RFC 5322 Simplified)
Stricter email validation following RFC 5322
HTTP/HTTPS URL
Matches HTTP and HTTPS URLs
URL (Any Protocol)
Matches URLs with any protocol scheme
US Phone Number
Matches US phone numbers in various formats
International Phone
Matches international phone numbers
Date (ISO 8601)
Matches dates in YYYY-MM-DD format
Date (MM/DD/YYYY)
Matches US-style dates (MM/DD/YYYY)
IPv4 Address
Matches valid IPv4 addresses (0.0.0.0 - 255.255.255.255)
IPv6 Address
Matches full IPv6 addresses (no shorthand)
Visa Card Number
Matches Visa card numbers (13 or 16 digits starting with 4)
Mastercard Number
Matches Mastercard numbers (16 digits starting with 51-55)
Credit Card (Any)
Matches Visa, Mastercard, Amex, or Discover card numbers
Strong Password
At least 8 chars: uppercase, lowercase, digit, and special character
Moderate Password
At least 6 chars: letters and digits required
Hex Color (#RRGGBB)
Matches 6-digit hex color codes
Hex Color (#RGB or #RRGGBB)
Matches 3 or 6 digit hex color codes
Integer
Matches positive or negative integers
Decimal Number
Matches decimal numbers with a required decimal point
URL Slug
Matches URL-friendly slugs (lowercase, hyphens)
Username (Alphanumeric)
3-16 chars: starts with letter, allows underscores
Why This Tool
Writing regular expressions from scratch is error-prone and time-consuming. This tool provides pre-built regex patterns for common use cases — emails, URLs, IP addresses, phone numbers, dates, and more — so you can grab a tested pattern instead of building one from scratch.
How It Works
Browse the pattern library or describe what you want to match. Select a pre-built regex pattern, customize it for your needs, and test it against sample input. Copy the final regex in your preferred language syntax (JavaScript, Python, Go, etc.).