Re:A Liberal, Accurate Regex Pattern for Matching URLs
by riffraff on Friday November 27, 2009 @05:30PM
(#964457)
what is wrong with URI.parse in the stdlib? the articles' re goes out of url validation to get urlish things in free text, (e.g. " lokk at http://goo.com/bat, lovely" the comma would actually be part of a valid url, but the regex tries to detect this. Yet, for url validation ruby's lib is enough, I believe.
[ Parent
| on HN ]
Re:A Liberal, Accurate Regex Pattern for Matching URLs
by ehsanul on Friday November 27, 2009 @09:07PM
(#964698)
Well, with URI.parse, you can send in a ftp uri, or just "something.com" (which is parsed as just a path). So not really what I need from URL validation. If there's something else I'm missing, I'm happy to know.
Edit: And btw, for an industrial-strength Ruby URI library (to replace the standard library), check out Addressable: http://addressable.rubyforge.org/