I am trying to validate the host section of the url, (not the entire url)
so in the case of http://www.example.com/some/path, all I want to validate is 'www.example.com'.
I have the following regex, ^((?:&#|[[:alnum:]]|[\-_])(?:&#|[[:alnum:]]|[\-\._~\?#\[\]@!$&'\(\)\*\+,;=])*(?::[0-9]{2,})?)$
and it works well in all cases, (including http://localhost and so on).
Looking at https://mathiasbynens.be/demo/url-regex, this all works fine except for 'sites' like http://उदाहरण.परीक्षा and http://⌘.ws, (are those actually allowed?)
If the given host names are possible, what regex could I use, over and above [[:alnum:]]
to validate host name like उदाहरण.परीक्षा and उदाहरण.परीक्षा:80?