$ devtools

Regex Library

New

Browse curated regex patterns for emails, URLs, dates, IPs, and more. Test against input.

Email addressContact
Standard email format
/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/
Phone (US)Contact
US phone numbers in various formats
/^\+?1?\s?\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}$/
ZIP code (US)Contact
5-digit or ZIP+4
/^\d{5}(-\d{4})?$/
URL (HTTP/HTTPS)Web
HTTP or HTTPS URLs
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_+.~#?&//=]*)/i
IPv4 addressWeb
Valid IPv4 (0–255 per octet)
/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/
IPv6 addressWeb
Full-form IPv6 address
/^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/
Date (YYYY-MM-DD)Date & Time
ISO 8601 date format
/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/
Time (HH:MM:SS)Date & Time
24-hour time
/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/
Unix timestampDate & Time
10-digit (s) or 13-digit (ms)
/^\d{10}(\d{3})?$/
Hex colorCode
CSS hex color code
/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/
UUID v4Code
UUID version 4
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
Semantic versionCode
SemVer major.minor.patch
/^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/
JWTCode
JSON Web Token (3 dot-separated parts)
/^[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]*$/
Base64 stringCode
Standard Base64
/^[A-Za-z0-9+/]+=*$/
URL slugCode
Lowercase URL-safe slug
/^[a-z0-9]+(?:-[a-z0-9]+)*$/
Credit card (16-digit)Finance
16-digit number with optional separators
/^\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}$/
IBANFinance
International Bank Account Number
/^[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z0-9]?){0,16}$/
MAC addressNetwork
Ethernet MAC with : or - separators
/^([0-9A-Fa-f]{2}[:\-]){5}[0-9A-Fa-f]{2}$/
CIDR notationNetwork
IP address with subnet mask
/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)\/(\d|[12]\d|3[012])$/