U
    5³dà  ã                   @   sp  d Z ddlZdZdZdZdeƒ  Zdeƒ  ZdZd	Z	d
eƒ  Z
deƒ  Zdeƒ  Zdeƒ  Zdeƒ  ZdZdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  Zdeƒ  ZdZdeƒ  Zd eƒ  Z d eƒ  Z!d!eƒ  Z"d"eƒ  Z#d#eƒ  Z$d$eƒ  Z%d%eƒ  Z&d&eƒ  Z'd'd(„ Z(d)d*„ Z)d+d,„ Z*dS )-a  
Regex for URIs

These regex are directly derived from the collected ABNF in RFC3986
(except for DIGIT, ALPHA and HEXDIG, defined by RFC2234).

They should be processed with re.VERBOSE.

Thanks Mark Nottingham for this code - https://gist.github.com/138549
é    Nz[\x30-\x39]z[\x41-\x5A\x61-\x7A]z[\x30-\x39A-Fa-f]z %% %(HEXDIG)s %(HEXDIG)sz-(?: %(ALPHA)s | %(DIGIT)s | \- | \. | _ | ~ )z#(?: : | / | \? | \# | \[ | \] | @ )zI(?: ! | \$ | & | ' | \( | \) |
                     \* | \+ | , | ; | = )z?(?: %(unreserved)s | %(pct_encoded)s | %(sub_delims)s | : | @ )z%(?: %(gen_delims)s | %(sub_delims)s )z5%(ALPHA)s (?: %(ALPHA)s | %(DIGIT)s | \+ | \- | \. )*zÄ(?: %(DIGIT)s |
                    [\x31-\x39] %(DIGIT)s |
                    1 %(DIGIT)s{2} |
                    2 [\x30-\x34] %(DIGIT)s |
                    25 [\x30-\x35]
                )
z@%(dec_octet)s \. %(dec_octet)s \. %(dec_octet)s \. %(dec_octet)sz#([A-Fa-f0-9:]+[:$])[A-Fa-f0-9]{1,4}z;v %(HEXDIG)s+ \. (?: %(unreserved)s | %(sub_delims)s | : )+z+\[ (?: %(IPv6address)s | %(IPvFuture)s ) \]z8(?: %(unreserved)s | %(pct_encoded)s | %(sub_delims)s )*z;(?: %(unreserved)s | %(pct_encoded)s | %(sub_delims)s | : )z5(?: %(IP_literal)s | %(IPv4address)s | %(reg_name)s )z(?: %(DIGIT)s )*z.(?: %(userinfo)s @)? %(host)s (?: : %(port)s)?z
%(pchar)s*z
%(pchar)s+z<(?: %(unreserved)s | %(pct_encoded)s | %(sub_delims)s | @ )+z(?: / %(segment)s )*z,/ (?: %(segment_nz)s (?: / %(segment)s )* )?z&%(segment_nz_nc)s (?: / %(segment)s )*z#%(segment_nz)s (?: / %(segment)s )*Ú z¬(?: %(path_abempty)s |
               %(path_absolute)s |
               %(path_noscheme)s |
               %(path_rootless)s |
               %(path_empty)s
            )
z(?: %(pchar)s | / | \? )*z³(?: (?: // %(authority)s %(path_abempty)s ) |
                    %(path_absolute)s |
                    %(path_rootless)s |
                    %(path_empty)s
                )
zÃ(?: (?: // %(authority)s %(path_abempty)s ) |
                        %(path_absolute)s |
                        %(path_noscheme)s |
                        %(path_empty)s
                    )
z:%(relative_part)s (?: \? %(query)s)? (?: \# %(fragment)s)?zM^(?: %(scheme)s : %(hier_part)s (?: \? %(query)s )? (?: \# %(fragment)s )? )$z"^(?: %(URI)s | %(relative_ref)s )$z6^(?: %(scheme)s : %(hier_part)s (?: \? %(query)s )? )$c                 C   s   t  t| t j¡S ©N)ÚreÚmatchÚURIÚVERBOSE©Úuri© r
   ú9/tmp/pip-unpacked-wheel-g6yohpa1/oauthlib/uri_validate.pyÚis_uriµ   s    r   c                 C   s   t  t| t j¡S r   )r   r   ÚURI_referencer   r   r
   r
   r   Úis_uri_reference¹   s    r   c                 C   s   t  t| t j¡S r   )r   r   Úabsolute_URIr   r   r
   r
   r   Úis_absolute_uri½   s    r   )+Ú__doc__r   ÚDIGITZALPHAZHEXDIGÚlocalsZpct_encodedZ
unreservedZ
gen_delimsZ
sub_delimsZpcharÚreservedÚschemeZ	dec_octetZIPv4addressZIPv6addressZ	IPvFutureZ
IP_literalZreg_nameÚuserinfoÚhostÚportÚ	authorityÚsegmentZ
segment_nzZsegment_nz_ncZpath_abemptyZpath_absoluteZpath_noschemeZpath_rootlessZ
path_emptyÚpathÚqueryÚfragmentZ	hier_partZrelative_partZrelative_refr   r   r   r   r   r   r
   r
   r
   r   Ú<module>   sb   






ú	














ú

ûû



