Common Regex Pattern Library
6 toolsBrowse categorized regex patterns for emails, dates, and more.
Runs in your browser — your files and text stay on your device
Browse a categorized library of common regex patterns for emails, URLs, dates, phone numbers and more. Copy a pattern as a starting point and adapt it. Patterns for things like email addresses are approximations, so validate important input another way too.
Contact info
^[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}$Email address^\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$US phone number^\+\d{1,3}[-.\s]?\d{4,14}$International phone number (E.164-ish)Web
^https?:\/\/[\w.-]+(\.[a-zA-Z]{2,})+([\/\w.-]*)*\/?$URL^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$IPv4 address^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$IPv6 address (full form)^#(?:[0-9a-fA-F]{3}){1,2}$Hex color codeIdentity & Finance
^\d{3}-\d{2}-\d{4}$US Social Security Number (SSN)^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14})$Credit card (Visa/Mastercard)^[A-Z]{2}\d{2}[A-Z0-9]{1,30}$IBAN (simplified)Dates & Numbers
^\d{4}-\d{2}-\d{2}$ISO date (YYYY-MM-DD)^\d{1,2}\/\d{1,2}\/\d{4}$US date (MM/DD/YYYY)^-?\d+(\.\d+)?$Integer or decimal number^\d{5}(-\d{4})?$US ZIP codePasswords & Usernames
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{8,}$Strong password (upper, lower, digit, symbol, 8+ chars)^[a-zA-Z0-9_]{3,16}$Username (letters, digits, underscore, 3–16 chars)Frequently asked questions
Are these patterns production-ready?
They cover the common cases well, but for anything security-critical (like SSNs or credit cards) treat them as a starting point, not a full validator.
How do I test one on my own text?
Copy it and switch to the Regex Tester tab to try it against sample input.