coolregex.
fyi
Search regex
Press
⌘
K
Password Strength
at least 8 characters, one uppercase, one lowercase, one number, one special character
^
(?=.*[a-z])
(?=.*[A-Z])
(?=.*d)
(?=.*[@$!%*?&])
[A-Za-zd@$!%*?&]
{8,}
$
Email Address
Validates a typical email address.
^
[a-zA-Z0-9._%+-]
+
@
[a-zA-Z0-9.-]
+
.
[a-zA-Z]
{2,}
$
URL
Matches HTTP/HTTPS URLs.
^
https
?
://
(www.)
?
[a-zA-Z0-9.-]
+
.
[a-zA-Z]
{2,}
(/S*)
?
$
IP Address (IPv4)
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 hexadecimal color codes (#FFFFFF or #FFF).
^
#
([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})
$
Extracting HTML Tags
Matches and extracts HTML tags and their contents.
<
([a-zA-Z]+)
([^<]+)
*
(?:>(.*)
</\1>|s
+
/>)
Passport Number
Matches Passport Numbers.
^
[A-PR-WY]
[1-9]
ds
?
d
{4}
[1-9]
$
Slug
Matches slugs (strings with only lowercase letters, numbers, and hyphens).
^
[a-z0-9]
+
(?:-[a-z0-9]+)
*
$