Re: [url] Requests for Feedback (was Feedback from TPAC)

On 12/22/2014 10:16 AM, Bjoern Hoehrmann wrote:
> * Sam Ruby wrote:
>> On 12/22/2014 08:50 AM, Julian Reschke wrote:
>>> RFC 3986 has a regexp that's expected to parse valid URIs consistent
>>> with the ABNF; see
>>> <http://greenbytes.de/tech/webdav/rfc3986.html#rfc.section.B>.
>>
>> That is indeed a regular expression.  I'll even grant that it seems
>> likely to handle valid URIs correctly.  My concern is that it also
>> processes a large number of invalid URIs, for example:
>> "http://192.168.0.257"
>
> (That is a `URI` as far as RFC 3986's ABNF grammar is concerned and I am
> not aware of prose requirements that make this example invalid. A better
> example would be e.g. something that contains `%xx` literally; the regex
> would likely accept the string while the grammar rejects it.)

I base my assertion that this is not a valid URI based on the following 
quote from RFC 3986:

       IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

       dec-octet   = DIGIT                 ; 0-9
                   / %x31-39 DIGIT         ; 10-99
                   / "1" 2DIGIT            ; 100-199
                   / "2" %x30-34 DIGIT     ; 200-249
                   / "25" %x30-35          ; 250-255

Do you come to a different conclusion?

- Sam Ruby

Received on Monday, 22 December 2014 15:23:34 UTC