4 ms·
You do realize that RFC 3986 actually contains an official regular expression, right? http://tools.ietf.org/html/rfc3986#appendix-B http://tools.ietf.org/html/r
by lazyloop 12y ago
You do realize that RFC 3986 actually contains an official regular expression, right? http://tools.ietf.org/html/rfc3986#appendix-B http://tools.ietf.org/html/rfc3986#appendix-B
- TazeTSchnitzel 12y agoThat's for parsing a "well-formed" URI, not validating a URI as well-formed in the first place, however :)
- saraid216 12y agoThat doesn't work for validation.
- lazyloop 12y agoOf course it does, if that regular expression matches we have a valid URI. It's silly what gets downvoted on HN these days.
- zAy0LfpBZLC8mAC 12y agoNo, it doesn't. This regular expression matches strings that are not URIs, and that should be quite obvious if you compare the grammar in that same RFC to the regex.
- lazyloop 12y agoYes, it does. And it is quite obvious if you compare the grammar to the regular expression.
- zAy0LfpBZLC8mAC 12y agoPlease show how to produce the following string (which is matched by that regex) from the grammar (without the quotes): "%x" (edit: actually, feel free to do it with the quotes included if you like, that would still be matched by that regex)
- mathias 12y agoYou do realize that RFC 3986 doesn’t actually match reality, right? http://url.spec.whatwg.org/#goals http://url.spec.whatwg.org/#goals