0

I want to check the domains with regex. I used this code but it doesn't work:

/^([^\s<>]+([^\s<>]*[^\s<>]+)?.){0,}([^\s<>]+([^\s<>]*[^\s<>]+)?){1,63}(.[^\s<>]{2,7})+$/i

My domain format is:

  • example.com

I don't want:

  • www.example.com
  • http://example.com
  • http://www.example.com

At the same time, user can add the domains;

  • with 2 extension like example.co.uk
  • as an IDN like üüüüüü.üüü
Alan Moore
  • 73,866
  • 12
  • 100
  • 156
user3620931
  • 131
  • 9

0 Answers0