Categories
Matches a valid domain name.
Contributed by @itsbrunodev
^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}$
# Valid domain names example.com sub.example.co.uk example-domain.com subdomain.example.com # Invalid domain names -example.com example..com example.c