|
@@ -1,112 +0,0 @@
|
|
|
-# https://www.ietf.org/rfc/rfc2396.txt
|
|
|
-"""
|
|
|
-The following definitions are common to many elements:
|
|
|
-
|
|
|
- alpha = lowalpha | upalpha
|
|
|
-
|
|
|
- lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
|
|
|
- "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
|
|
|
- "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
|
|
|
-
|
|
|
- upalpha = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
|
|
|
- "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
|
|
|
- "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
|
|
|
-
|
|
|
- digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
|
|
|
- "8" | "9"
|
|
|
-
|
|
|
- alphanum = alpha | digit
|
|
|
-
|
|
|
- uric = reserved | unreserved | escaped
|
|
|
-
|
|
|
- reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
|
|
|
- "$" | ","
|
|
|
-
|
|
|
- unreserved = alphanum | mark
|
|
|
-
|
|
|
- mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
|
|
|
-
|
|
|
- escaped = "%" hex hex
|
|
|
- hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
|
|
|
- "a" | "b" | "c" | "d" | "e" | "f"
|
|
|
-
|
|
|
- control = <US-ASCII coded characters 00-1F and 7F hexadecimal>
|
|
|
-
|
|
|
- space = <US-ASCII coded character 20 hexadecimal>
|
|
|
-
|
|
|
- delims = "<" | ">" | "#" | "%" | <">
|
|
|
-
|
|
|
- unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
|
|
|
-
|
|
|
- <scheme>:<scheme-specific-part>
|
|
|
-
|
|
|
- <scheme>://<authority><path>?<query>
|
|
|
-
|
|
|
- absoluteURI = scheme ":" ( hier_part | opaque_part )
|
|
|
-
|
|
|
- hier_part = ( net_path | abs_path ) [ "?" query ]
|
|
|
-
|
|
|
- net_path = "//" authority [ abs_path ]
|
|
|
-
|
|
|
- abs_path = "/" path_segments
|
|
|
-
|
|
|
- opaque_part = uric_no_slash *uric
|
|
|
-
|
|
|
- uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
|
|
|
- "&" | "=" | "+" | "$" | ","
|
|
|
-
|
|
|
- scheme = alpha *( alpha | digit | "+" | "-" | "." )
|
|
|
-
|
|
|
- authority = server | reg_name
|
|
|
-
|
|
|
- Within the authority component, the characters ";", ":",
|
|
|
- "@", "?", and "/" are reserved.
|
|
|
-
|
|
|
- reg_name = 1*( unreserved | escaped | "$" | "," |
|
|
|
- ";" | ":" | "@" | "&" | "=" | "+" )
|
|
|
-
|
|
|
- <userinfo>@<host>:<port>
|
|
|
-
|
|
|
- server = [ [ userinfo "@" ] hostport ]
|
|
|
-
|
|
|
- userinfo = *( unreserved | escaped |
|
|
|
- ";" | ":" | "&" | "=" | "+" | "$" | "," )
|
|
|
-
|
|
|
- hostport = host [ ":" port ]
|
|
|
- host = hostname | IPv4address
|
|
|
- hostname = *( domainlabel "." ) toplabel [ "." ]
|
|
|
- domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
|
|
|
- toplabel = alpha | alpha *( alphanum | "-" ) alphanum
|
|
|
-
|
|
|
- IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
|
|
|
- port = *digit
|
|
|
-
|
|
|
-"""
|
|
|
-# uric := URI characters
|
|
|
-lowalpha = 'a-z'
|
|
|
-upalpha = 'A-Z'
|
|
|
-alpha = f'{lowalpha}{upalpha}'
|
|
|
-digit = '0-9'
|
|
|
-alphanum = f'{alpha}{digit}'
|
|
|
-reserved_no_slash = r';\?:@&=\+\$,'
|
|
|
-reserved = f'/{reserved_no_slash}'
|
|
|
-_mark = r"\-_\.!~*'()"
|
|
|
-hex = f'a-fA-F{digit}'
|
|
|
-escaped = f"%[{hex}][{hex}]"
|
|
|
-unreserved = f'{alphanum}{_mark}'
|
|
|
-control = b''
|
|
|
-#for i in chain(range(int('0x1F', 0)+1), [int('0x7F', 0)]):
|
|
|
-# control += control + bytes(i)
|
|
|
-control = control.decode('ascii')
|
|
|
-space = ' '
|
|
|
-delims = r'\<\>#%"'
|
|
|
-unwise = r'{}|\\\^\[\]`'
|
|
|
-excluded = f'{control}{space}{delims}{unwise}'
|
|
|
-scheme = f'[{alpha}][{alphanum}+.-]*'
|
|
|
-authority_reserved = r';:@\?/'
|
|
|
-reg_name_aux = r'\$,;:@&=\+'
|
|
|
-reg_name = f'([{unreserved}]|{escaped}|{reg_name_aux})+'
|
|
|
-user_info_aux = r'\$,;:&=\+'
|
|
|
-user_info = f'([{unreserved}]|{escaped}|{user_info_aux})+'
|
|
|
-server = r'({user_info}@)?'
|
|
|
-# ... gave up
|