Regex Tester
Test and validate regular expressions with real-time matching
0 matches found
Regular Expression Pattern
Enter your regex pattern and configure flags
//
Flags
Test String
Enter the text you want to test against your regex pattern
Common Patterns
Quick start with commonly used regex patterns
Validates email addresses
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Phone Number (US)
Matches US phone numbers
^\+?1?[-.\s]?\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})$
URL
Matches HTTP/HTTPS URLs
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
IPv4 Address
Validates IPv4 addresses
^(?:(?: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]?)$
Hex Color
Matches hex color codes
^#(?:[0-9a-fA-F]{3}){1,2}$
Credit Card
Validates credit card numbers
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3[0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$