Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(\*|)(\.|)((http(s|):\/\/)|)((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+(xn--)?[a-z0-9-]{1,62}[a-z](\/|)(\*|)$
/
gmi
Input 1
New
### REGEX FOR DOMAIN NAME VALIDATION ### ### From PHPfrance : https://www.phpfrance.com ### ### List of example valid domain names ### www.google.com google.com google.xn--pgbs0dh google.co.uk mkyong123.com mkyong-info.com sub.mkyong.com sub.mkyong-info.com mkyong.com.au g.co mkyong.t.t.co xn--c6h.com www.domain.photography http://www.google.com https://www.google.com ### List of invalid domain names examples, and why ### # Tld must not be less than 2 characters mkyong.t.t.c # Comma is not allow mkyong,com # No Tld mkyong # Tld not allow ONLY digits mkyong.123 # Must start with [a-z0-9] .com # No Tld mkyong.com/users # Cannot begin with a hyphen - -mkyong.com # Cannot end with a hyphen - mkyong-.com # Cannot begin with a hyphen - sub.-mkyong.com ### Test all 1531 existing TLDs (as of 2019-05-29) ### Source : http://data.iana.org/TLD/tlds-alpha-by-domain.txt test.aaa test.aarp test.abarth test.abb test.abbott test.abbvie test.abc test.able test.abogado test
Substitution
*.$6/*
### REGEX FOR DOMAIN NAME VALIDATION ### ### From PHPfrance : https://www.phpfrance.com ### ### List of example valid domain names ### www.google.com google.com google.xn--pgbs0dh google.co.uk mkyong123.com mkyong-info.com sub.mkyong.com sub.mkyong-info.com mkyong.com.au g.co mkyong.t.t.co xn--c6h.com www.domain.photography http://www.google.com https://www.google.com ### List of invalid domain names examples, and why ### # Tld must not be less than 2 characters mkyong.t.t.c # Comma is not allow mkyong,com # No Tld mkyong # Tld not allow ONLY digits mkyong.123 # Must start with [a-z0-9] .com # No Tld mkyong.com/users # Cannot begin with a hyphen - -mkyong.com # Cannot end with a hyphen - mkyong-.com # Cannot begin with a hyphen - sub.-mkyong.com ### Test all 1531 existing TLDs (as of 2019-05-29) ### Source : http://data.iana.org/TLD/tlds-alpha-by-domain.txt test.aaa test.aarp test.abarth test.abb test.abbott test.abbvie test.abc test.able test.abogado test