|
| list | url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"] |
| |
| tuple | NORMALIZABLE_SCHEMES = ("http", "https", None) |
| |
| | PERCENT_RE = re.compile(r"%[a-fA-F0-9]{2}") |
| |
| | SCHEME_RE = re.compile(r"^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)") |
| |
| | URI_RE |
| |
| str | IPV4_PAT = r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}" |
| |
| str | HEX_PAT = "[0-9A-Fa-f]{1,4}" |
| |
| str | LS32_PAT = "(?:{hex}:{hex}|{ipv4})".format(hex=HEX_PAT, ipv4=IPV4_PAT) |
| |
| dict | _subs = {"hex": HEX_PAT, "ls32": LS32_PAT} |
| |
| list | _variations |
| |
| str | UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~" |
| |
| str | IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")" |
| |
| str | ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+" |
| |
| str | IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]" |
| |
| str | REG_NAME_PAT = r"(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*" |
| |
| | TARGET_RE = re.compile(r"^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$") |
| |
| | IPV4_RE = re.compile("^" + IPV4_PAT + "$") |
| |
| | IPV6_RE = re.compile("^" + IPV6_PAT + "$") |
| |
| | IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT + "$") |
| |
| | BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT[2:-2] + "$") |
| |
| | ZONE_ID_RE = re.compile("(" + ZONE_ID_PAT + r")\]$") |
| |
| tuple | _HOST_PORT_PAT |
| |
| | _HOST_PORT_RE = re.compile(_HOST_PORT_PAT, re.UNICODE | re.DOTALL) |
| |
| | UNRESERVED_CHARS |
| |
| | SUB_DELIM_CHARS = set("!$&'()*+,;=") |
| |
| | USERINFO_CHARS = UNRESERVED_CHARS | SUB_DELIM_CHARS | {":"} |
| |
| | PATH_CHARS = USERINFO_CHARS | {"@", "/"} |
| |
| | QUERY_CHARS = PATH_CHARS | {"?"} |
| |