Regex Pattern Library — Common Patterns
Copy-ready regular expressions for email, URL, IP address, phone, credit card, UUID, date, and more. Click to copy, test against your input, and export as JSON. Free, no upload.
Pattern reference
| Category | Pattern name | Best for | Flags |
|---|---|---|---|
| Validation | Email address | Sign-up forms, contact fields | none |
| Web & URL | URL (WHATWG spec) | Links, href attributes | gi |
| Web & URL | Domain name | Hostname validation | none |
| Numbers & IDs | UUID v4 | Database IDs, tokens | none |
| Numbers & IDs | IPv4 address | IP allowlists, config | none |
| Numbers & IDs | IPv6 address | IP allowlists, config | none |
| Numbers & IDs | Credit card number | Form pre-validation (not secure) | none |
| Numbers & IDs | US phone number | North American numbers | gi |
| Security | Strong password | 8+ chars, mixed case, digit, special | none |
| Dates & Times | ISO 8601 date | APIs, log timestamps | none |
| Dates & Times | US date (MM/DD/YYYY) | US-localised dates | none |
| Dates & Times | 24-hour time | Timestamps, schedules | none |
| Text & Words | Slug / URL safe | URL slugs, identifiers | none |
| Text & Words | Hashtag | Social media parsing | gi |
| Text & Words | Hex color | CSS, design tokens | none |
Why these patterns and not others
Most regex libraries either show a one-liner that passes most test cases but rejects valid inputs, or they show the RFC-correct 6,000-character monster that no one can maintain. This library takes a middle path: patterns that pass real-world inputs with known limitations clearly documented. Email uses the RFC 5321 practical subset, not the full RFC 5322 ABNF. URL uses the WHATWG spec, not the RFC. IPv4 handles dotted-quad with optional leading zeros. Credit card uses Luhn-aware length rules.
The copy button encodes the pattern for JavaScript regex literal syntax (`/pattern/flags`) where needed. For PCRE/PHP use the same pattern without delimiters. For Python, prepend `r""` or use the `re` module directly. For Go, use `regexp.MustCompile`. For .NET, the same literal works in most cases.
Pattern categories explained
Validation patterns enforce structure: they use `^` and `$` anchors to ensure the whole string matches. Search patterns leave anchors off so you can find matches inside longer text. The grid below labels each card with its primary use — validate or search — and the appropriate flags (`g` for global, `i` for case-insensitive).
Date patterns cover ISO 8601 (YYYY-MM-DD), US (MM/DD/YYYY), EU (DD/MM/YYYY) and ISO with time. Note that DD/MM/YYYY cannot be reliably distinguished from MM/DD/YYYY without context — both are valid formats for different locales, so choose based on your audience.
Next steps
- Regex Tester— test a copied pattern live
- Regex Explainer— understand what a pattern means
Frequently Asked Questions
How do I use these patterns?
Are these patterns production-ready?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.