Regex Library
Common regex patterns with descriptions, examples, and one-click copy.
Search for a command to run...
Email Address
Validates standard email addresses
^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$user@example.comURL
Matches HTTP/HTTPS URLs
https?://[\w.-]+(?:\.[\w.-]+)+[\w.,@?^=%&:/~+#-]*https://example.com/pathIPv4 Address
Validates IPv4 addresses (0.0.0.0 – 255.255.255.255)
^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$192.168.1.1Phone (International)
E.164 international phone number format
^\+?[1-9]\d{1,14}$+14155552671Hex Color
Matches 3 or 6 digit hex color codes
^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$#ff5733Credit Card
Visa, Mastercard, or Amex card numbers
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13})$4111111111111111Date (YYYY-MM-DD)
ISO 8601 date format
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$2025-12-31Time (HH:MM:SS)
24-hour time format
^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$14:30:00UUID v4
Standard 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}$550e8400-e29b-41d4-a716-446655440000Slug
URL-safe slug (lowercase, hyphens)
^[a-z0-9]+(?:-[a-z0-9]+)*$my-blog-postUsername
Alphanumeric username (3-20 chars)
^[a-zA-Z0-9_]{3,20}$john_doe42Strong Password
At least 8 chars: uppercase, lowercase, digit, special
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$Str0ng!PassJWT Token
JSON Web Token format (3 base64url parts)
^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$eyJhbG.eyJzdW.SflKxwHTML Tag
Matches simple paired HTML tags
<([a-z][a-z0-9]*)\b[^>]*>(.*?)</\1><p>text</p>Markdown Link
Markdown-style links [text](url)
\[([^\]]+)\]\(([^)]+)\)[Click](https://x.com)CSS Hex/RGB
CSS color values (hex or rgb/rgba)
#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)rgba(255,0,0,0.5)Whitespace Trim
Leading and trailing whitespace
^\s+|\s+$ hello Duplicate Words
Finds consecutive duplicate words
\b(\w+)\s+\1\bthe the quick