U
    nh                     @   sL   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rHddlZe  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   \/var/www/html/peyman_registration/venvv2/lib/python3.8/site-packages/phonenumbers/re_util.pyr      s    r   c                 C   s:   t d| j | j}||}|r6| t|k r6d}|S )r   z^(?:%s)$N)recompiler   flagsmatchendlen)r   r   Zgrouped_patternmr   r   r	   r   %   s
    
__main__)__doc__r
   sysversion_infor   __name__doctesttestmodr   r   r   r	   <module>   s   

