Matches valid email addresses
^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$
user@example.com
john.doe@company.co.uk
invalid.email@
no@domain
Matches international phone numbers (E.164 format)
^\+?[1-9]\d{1,14}$
+1234567890
+442071234567
12345
not-a-number
Matches valid 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]?)$
192.168.1.1
10.0.0.0
256.1.2.3
1.2.3
Matches valid HTTP/HTTPS URLs
^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
https://www.example.com
http://subdomain.site.co.uk/path
not-a-url
ftp://invalid.com
Minimum 8 characters, at least one letter, one number, and one special character
^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$
StrongP@ss1
Weak123
NoNumber@
short1!
Matches dates in YYYY-MM-DD format
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
2024-02-29
2023-12-31
2024-13-01
24-5-1
3-16 characters, letters, numbers, underscore, hyphen
^[a-zA-Z0-9_-]{3,16}$
john_doe
user123
a
too_long_username_123
Matches 3 or 6 character hex colors
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
#ff0000
#f00
ff0000
#xyz123