ng2-validation icon indicating copy to clipboard operation
ng2-validation copied to clipboard

Validating URLs with an underscore in the subdomain.

Open scotthovestadt opened this issue 8 years ago • 2 comments

Currently, the URL parsing fails for any URL that includes a subdomain with an underscore. For example: my_domain.scott.com

This isn't a completely straightforward issue, because technically underscores in subdomains aren't standards compliant -- even if it's used and tends to work in every browser.

@yuyang041060120 Would you accept a pull request to allow for underscores in the subdomain?

scotthovestadt avatar Dec 19 '16 23:12 scotthovestadt

The regex seems pretty restrictive in what it allows :(

http://localhost:11795/ for example is not considered a valid URL, neither would http://machinename/ be.

telnet://whatever.com/ wouldn't be considered a valid URL either since the regex seems to restrict the protocol to http/s and ftp.

kevindqc avatar Mar 24 '17 21:03 kevindqc

localhost should be added. I'm running into a situation where I need this.

matthewswallace avatar Sep 15 '17 18:09 matthewswallace