I want to check some domains with regular expression (regex). My old code was:
/^([a-z0-9]+([-a-z0-9]*[a-z0-9]+)?.){0,}([a-z0-9]+([-a-z0-9]*[a-z0-9]+)?){1,63}(.[a-z0-9]{2,7})+$/i
It works but this code doesn't validate IDNs (internationalized domain names) such as öü.com or öü.öü and doesn't check "www", "http://" terms.
My domain format is:
- example.com
Besides, I don't want:
- www.example.com
- http://example.com
- http://www.example.com
Important note: user can add the domains;
- with 2 extension like example.co.uk