Regex Tester
Test regular expressions against text with live highlighting.
#regex#regexp#pattern#test
1 min read
//
Match Preview (0 matches)
Enter test text to see matches
Capture Groups
No capture groups to display
Common Patterns Library
Email
/^[\w.-]+@[\w.-]+\.\w+$/Matches email addresses
Phone (US)
/^\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})$/US phone numbers
URL
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/HTTP/HTTPS URLs
IP Address
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/IPv4 address
Date (MM/DD/YYYY)
/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d\d$/Date in MM/DD/YYYY format
Hex Color
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/Hex color codes
Password (Strong)
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/Min 8 chars, upper, lower, number, special
Alphanumeric
/^[a-zA-Z0-9]+$/Letters and numbers only