Project

General

Profile

Bug #454 ยป 454.patch

jonaswitt (Jonas Witt), 12/19/2008 03:44 AM

View differences:

lib/uri/common.rb (working copy)
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
......
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 | ";" | "?" | ":" | "@" |
    (1-1/1)