News for hackers. Stuff that matters.
Re:In search of the perfect URL validation regex by to3m on Sunday June 22, 2014 @04:00PM (#7928990)
If you're going to allow dotted IPs you should really allow 32-bit IPs too, e.g., http://0xadc229b7, http://2915183031 and http://025560424667. (The validity of this last one was news to me I must admit.)
Re:In search of the perfect URL validation regex by baddox on Sunday June 22, 2014 @05:24PM (#7929277)
Re:In search of the perfect URL validation regex by gamegoblin on Sunday June 22, 2014 @06:11PM (#7929403)
Since I just finished implementing a toy HTTP/1.1 server, I must throw in my newfound knowledge that 2732 has been updated with Zone IDs:

http://tools.ietf.org/html/rfc6874

Re:In search of the perfect URL validation regex by DanBlake on Sunday June 22, 2014 @04:13PM (#7929030)
Yep.

I should mention that 99.9% of domains will fall into standard form ( handle.domain or ip.ip.ip.ip )

As such, You are definitely more likely to let a user enter a bad URL they did not intend because it validates then to let a uncommon domain actually be used.

As such- a much simpler regex would likely 'make more people happy' than being 100% correct to tech spec.

Re:In search of the perfect URL validation regex by zAy0LfpBZLC8mAC on Sunday June 22, 2014 @10:18PM (#7929883)
None of those is a URI, so a URI validator most certainly should not accept them. Just because browsers tend to understand them as a matter of a historical accident does not mean those are valid URIs, just as tag soup that browsers also tend to understand isn't valid HTML either.
Re:In search of the perfect URL validation regex by mathias on Monday June 23, 2014 @02:42AM (#7930553)
Exactly. The goal was to come up with a good regular expression to validate URLs as user input. There’s no way I’d want to allow alternate IP address notations.
Re:In search of the perfect URL validation regex by to3m on Monday June 23, 2014 @05:57PM (#7934979)
Yes... I've found the relevant RFC now. How disappointing! I like 32-bit hex IP addresses.