Regex Validator

Test and validate regular expressions with real-time feedback

Regex Pattern

Enter your regular expression pattern

Test Strings

Enter strings to test your regex against (one per line)

Results

See which strings match your pattern

No results to display

Common Patterns

Click to use these predefined patterns with example strings

Email
^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$
Matches valid email addresses
URL
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
Matches HTTP/HTTPS URLs
Phone Number
^\+?[1-9]\d{1,14}$
Matches international phone numbers
Date (YYYY-MM-DD)
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
Matches dates in YYYY-MM-DD format
Strong Password
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Matches passwords with at least 8 characters, including uppercase, lowercase, number, and special character

Flag Reference

Common regex flags and their meanings

g
Global - Find all matches
i
Case-insensitive matching
m
Multiline - ^ and $ match start/end of each line
s
Dot (.) matches newlines too
u
Unicode support