Index: lib/uri/common.rb =================================================================== --- lib/uri/common.rb (revision 20727) +++ lib/uri/common.rb (working copy) @@ -14,8 +14,7 @@ module PATTERN # :stopdoc: - # RFC 2396 (URI Generic Syntax) - # RFC 2732 (IPv6 Literal Addresses in URL's) + # RFC 3986 (URI Generic Syntax, Obsoletes: 2732, 2396, 1808) # RFC 2373 (IPv6 Addressing Architecture) # alpha = lowalpha | upalpha @@ -28,16 +27,16 @@ HEX = "a-fA-F\\d" # escaped = "%" hex hex ESCAPED = "%[#{HEX}]{2}" - # mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | - # "(" | ")" - # unreserved = alphanum | mark - UNRESERVED = "-_.!~*'()#{ALNUM}" - # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | - # "$" | "," - # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | - # "$" | "," | "[" | "]" (RFC 2732) - RESERVED = ";/?:@&=+$,\\[\\]" - + + # unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" (RFC 3986) + UNRESERVED = "-_.~#{ALNUM}" + + # reserved = gen-delims / sub-delims + # gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" + # sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + # / "*" / "+" / "," / ";" / "=" (RFC 3986) + RESERVED = ":/?\#\\[\\]@!$&'\\(\\)*+,;=" + # uric = reserved | unreserved | escaped URIC = "(?:[#{UNRESERVED}#{RESERVED}]|#{ESCAPED})" # uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |