Re:In search of the perfect URL validation regex
by mcpherrinm on Sunday June 22, 2014 @05:47PM
(#7929342)
This is the context of a URL shortener, and one of the goals seems to prohibit bad IPs, not all IPs. Bad seems to be defined here as ones in the private IP spaces, and those in multicast space, etc.
Re:In search of the perfect URL validation regex
by lucb1e on Sunday June 22, 2014 @06:08PM
(#7929393)
Okay, that makes sense!
Re:In search of the perfect URL validation regex
by gamegoblin on Sunday June 22, 2014 @06:15PM
(#7929410)
According to the RFC, since domains are allowed to be entirely numeric, there is overlap between valid domains and valid IP addresses. The RFC says that if something could be a valid IP address, it is to be thought of as an IP address.
And why must the root period behind the domain be omitted from URLs? Not only does it work in a browser (and people end sentences with periods), the domain should actually end in a period all the time but it's usually omitted for ease of use. Only some DNS applications still require domains to end with root dots.