o
    i                     @   sP   d Z ddlZddlZejdkrdd Zndd Zedkr&ddlZe  dS dS )uF  Additional regular expression utilities, to make it easier to sync up
with Java regular expression code.

>>> import re
>>> from .re_util import fullmatch
>>> from .util import u
>>> string = 'abcd'
>>> r1 = re.compile('abcd')
>>> r2 = re.compile('bc')
>>> r3 = re.compile('abc')
>>> fullmatch(r1, string)  # doctest: +ELLIPSIS
<...Match object...>
>>> fullmatch(r2, string)
>>> fullmatch(r3, string)
>>> r = re.compile(r'\d{8}|\d{10,11}')
>>> m = fullmatch(r, '1234567890')
>>> m.end()
10
>>> r = re.compile(u(r'[+＋\d]'), re.UNICODE)
>>> m = fullmatch(r, u('０'))
>>> m.end()
1
    N)      c                 C   s
   |  |S )Try to apply the pattern at the start of the string, returning a match
        object if the whole string matches, or None if no match was found.)	fullmatch)patternstring r   t/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/phonenumbers/re_util.pyr      s   
r   c                 C   s:   t d| j | j}||}|r| t|k rd}|S )r   z^(?:%s)$N)recompiler   flagsmatchendlen)r   r   grouped_patternmr   r   r	   r   %   s
   
__main__)__doc__r
   sysversion_infor   __name__doctesttestmodr   r   r   r	   <module>   s    

