Regex Pattern Library
42 tested regex patterns with one-click copy.
Free & unlimited
Search
Category
Basic email
Matches most common email formats.
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/gEmail
Strict email (RFC)
Stricter RFC 5322 email validation.
/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/Email
Disposable email domains
Detect common disposable email providers.
/@(mailinator|guerrillamail|tempmail|throwaway|yopmail)\./giEmail
US phone
US phone numbers in various formats.
/(?:\+?1[-\s.]?)?\(?[2-9]\d{2}\)?[-\s.]?\d{3}[-\s.]?\d{4}/gPhone
UK phone
UK phone numbers.
/(?:\+44|0)\s?[1-9]\d{1,4}\s?\d{3,4}\s?\d{3,4}/gPhone
E.164 international
International phone in E.164 format.
/\+[1-9]\d{6,14}/gPhone
Danish phone
Danish 8-digit phone numbers.
/(?:\+45\s?)?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}/gPhone
HTTP/HTTPS URL
Match HTTP and HTTPS URLs.
/https?://[\w-]+(\.[\w-]+)+(/[\w.,@?^=%&:/~+#-]*)?/giURL
URL with optional protocol
URLs with or without http(s)://.
/(?:https?://)?(?:www\.)?[\w-]+(\.[\w-]+)+(/[\w.,@?^=%&:/~+#-]*)?/giURL
URL slug
Valid URL slug (lowercase, hyphens).
/^[a-z0-9]+(?:-[a-z0-9]+)*$/URL
IPv4 address
Valid IPv4 addresses (0.0.0.0 – 255.255.255.255).
/(?: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?)/gIP address
Private IP ranges
Private/internal IP ranges (RFC 1918).
/(?:10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})/gIP address
IPv6 address
Full IPv6 addresses.
/(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}/gIP address
ISO 8601 date
YYYY-MM-DD format.
/\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])/gDate & time
European date
DD/MM/YYYY format.
/(?:0[1-9]|[12]\d|3[01])/(?:0[1-9]|1[0-2])/\d{4}/gDate & time
US date
MM-DD-YYYY format.
/(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])-\d{4}/gDate & time
24h time
HH:MM or HH:MM:SS in 24-hour format.
/(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?/gDate & time
ISO datetime
Full ISO 8601 datetime with timezone.
/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?/gDate & time
Visa card
Visa card numbers (starts with 4).
/4[0-9]{12}(?:[0-9]{3})?/gCredit card
Mastercard
Mastercard numbers (starts with 51–55).
/5[1-5][0-9]{14}/gCredit card
American Express
Amex card numbers (starts with 34 or 37).
/3[47][0-9]{13}/gCredit card
Danish CPR
Danish personal ID (DDMMYY-XXXX).
/(?:0[1-9]|[12]\d|3[01])(?:0[1-9]|1[0-2])\d{2}-?\d{4}/gID numbers
US SSN
US Social Security Number.
/(?!000|666|9\d{2})\d{3}-(?!00)\d{2}-(?!0000)\d{4}/gID numbers
UK NI number
UK National Insurance number.
/[A-CEGHJ-PR-TW-Z]{2}\d{6}[A-D]/giID numbers
UUID v4
UUID version 4 format.
/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/giID numbers
US ZIP code
US 5-digit or ZIP+4 format.
/\d{5}(-\d{4})?/gPostal code
UK postcode
UK postcode format.
/[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}/giPostal code
Danish postal code
Danish 4-digit postal code.
/\b\d{4}\b/gPostal code
German PLZ
German 5-digit postal code.
/\b\d{5}\b/gPostal code
Alphanumeric username
Letters and numbers only, 3–20 chars.
/^[a-zA-Z0-9]{3,20}$/Username
Social handle (@)
Twitter/Instagram-style handle.
/@[a-zA-Z][a-zA-Z0-9_]{1,14}/gUsername
Strong password
Min 8 chars, upper + lower + number + special.
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*]).{8,}$/Password
HTML tag
Match HTML opening + closing tag pairs.
/<([a-z][a-z0-9]*)\b[^>]*>(.*?)</\1>/gisHTML & code
HTML attribute
Extract attribute key-value pairs.
/(\w+)=["']([^"']*)["']/gHTML & code
Hex color code
CSS hex color (#RGB or #RRGGBB).
/#(?:[0-9a-fA-F]{3}){1,2}\b/gHTML & code
JS import statement
JavaScript import statements.
/import\s+(?:\{[^}]+\}|\w+)\s+from\s+['"][^'"]+['"]/gHTML & code
Semantic version
Semantic versioning (major.minor.patch).
/\bv?\d+\.\d+\.\d+(?:-[\w.]+)?(?:\+[\w.]+)?\b/gHTML & code
Excess whitespace
Two or more consecutive whitespace characters.
/\s{2,}/gMisc
Duplicate words
Repeated consecutive words.
/\b(\w+)\s+\1\b/giMisc
Number with commas
Numbers with thousand separators.
/\d{1,3}(,\d{3})*(\.\d+)?/gMisc
Markdown link
Markdown [text](url) links.
/\[([^\]]+)\]\(([^)]+)\)/gMisc
JSON key
JSON object keys.
/"(\w+)"\s*:/gMisc
All processing happens in your browser. No data is sent to any server.
About this tool
- 1
Browse or search
Browse categories like Email, Phone, URL, IP, or search by name.
- 2
View pattern details
Each pattern shows the regex, a plain-English description, and match/non-match examples.
- 3
Copy or test
Click to copy the regex, or click "Test it" to open the inline tester.
- Use the flag selector (g, i, m) to customize how the regex behaves.
- The inline tester lets you paste your own text and see matches highlighted in real-time.
- Search works across both pattern names and descriptions.
- 100+ pre-built regex patterns
- Categories: Email, Phone, URL, IP, Date, Credit Card, and more
- Inline regex tester
- Match and non-match examples
- One-click copy
- Finding the right regex for form validation
- Learning regex through curated examples
- Quickly testing patterns against sample data