+
    8i                        R t ^ RIHt ^ RIt^ RIHtHtHtHtH	t	H
t
 ^ RIHtHt ^ RIHt R R lt]	! R]]4      t ! R	 R
]],          4      tR# )z3Tools for representing MongoDB regular expressions.)annotationsN)AnyGenericPatternTypeTypeVarUnion)_getstate_slots_setstate_slots)RE_TYPEc                    V ^8  d   QhRRRR/# )   	str_flagsstrreturnint )formats   "H/var/www/html/photoedit/myenv/lib/python3.14/site-packages/bson/regex.py__annotate__r      s            c                r   ^ pRV 9   d   V\         P                  ,          pRV 9   d   V\         P                  ,          pRV 9   d   V\         P                  ,          pRV 9   d   V\         P                  ,          pRV 9   d   V\         P
                  ,          pRV 9   d   V\         P                  ,          pV# )    ilmsux)re
IGNORECASELOCALE	MULTILINEDOTALLUNICODEVERBOSE)r   flagss   & r   str_flags_to_intr'      s    E
i
i
i
i
i
iLr   _Tc                      ] tR t^.tRtRt]t]t	^t
]R R l4       tRR R lltR R ltRtR	 R
 ltR R ltR R ltRtR# )RegexzBSON regular expression data.c               $    V ^8  d   QhRRRRRR/# )r   clszType[Regex[Any]]regexPattern[_T]r   z	Regex[_T]r   )r   s   "r   r   Regex.__annotate__9   s"     1 1) 1+ 1) 1r   c                    \        V\        4      '       g   \        R\        V4      ,          4      h\	        VP
                  VP                  4      # )a,  Convert a Python regular expression into a ``Regex`` instance.

Note that in Python 3, a regular expression compiled from a
:class:`str` has the ``re.UNICODE`` flag set. If it is undesirable
to store this flag in a BSON regular expression, unset it first::

  >>> pattern = re.compile('.*')
  >>> regex = Regex.from_native(pattern)
  >>> regex.flags ^= re.UNICODE
  >>> db.collection.insert_one({'pattern': regex})

:param regex: A regular expression object from ``re.compile()``.

.. warning::
   Python regular expressions use a different syntax and different
   set of flags than MongoDB, which uses `PCRE`_. A regular
   expression retrieved from the server may not compile in
   Python, or may match a different set of strings in Python than
   when used in a MongoDB query.

.. _PCRE: http://www.pcre.org/
z3regex must be a compiled regular expression, not %s)
isinstancer   	TypeErrortyper*   patternr&   )r,   r-   s   &&r   from_nativeRegex.from_native8   s>    0 %))QTXY^T__``U]]EKK00r   c               $    V ^8  d   QhRRRRRR/# )r   r4   r(   r&   zUnion[str, int]r   Noner   )r   s   "r   r   r/   U   s&     S S S? S4 Sr   c                >   \        V\        \        34      '       g   \        R\	        V4      ,          4      hWn        \        V\        4      '       d   \        V4      V n        R# \        V\        4      '       d	   W n        R# \        R\	        V4      ,          4      h)a"  BSON regular expression data.

This class is useful to store and retrieve regular expressions that are
incompatible with Python's regular expression dialect.

:param pattern: string
:param flags: an integer bitmask, or a string of flag
    characters like "im" for IGNORECASE and MULTILINE
z pattern must be a string, not %sz%flags must be a string or int, not %sN)	r1   r   bytesr2   r3   r4   r'   r&   r   )selfr4   r&   s   &&&r   __init__Regex.__init__U   so     'C<00>gNOO"eS!!)%0DJs##JCd5kQRRr   c                    V ^8  d   QhRRRR/# r   otherr   r   boolr   )r   s   "r   r   r/   j   s     " "C "D "r   c                	    \        V\        4      '       d;   V P                  VP                  8H  ;'       d    V P                  VP                  8H  # \        # N)r1   r*   r4   r&   NotImplementedr;   r@   s   &&r   __eq__Regex.__eq__j   s=    eU##<<5==0NNTZZ5;;5NN!!r   Nc                    V ^8  d   QhRRRR/# r?   r   )r   s   "r   r   r/   r   s     ! !C !D !r   c                	    W8X  * # rC   r   rE   s   &&r   __ne__Regex.__ne__r   s      r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r/   u   s     : :# :r   c                	@    R V P                   : RV P                  : R2# )zRegex(z, )r4   r&   r;   s   &r   __repr__Regex.__repr__u   s     'r$**q99r   c                   V ^8  d   QhRR/# )r   r   r.   r   )r   s   "r   r   r/   x   s     4 4[ 4r   c                X    \         P                  ! V P                  V P                  4      # )a  Compile this :class:`Regex` as a Python regular expression.

.. warning::
   Python regular expressions use a different syntax and different
   set of flags than MongoDB, which uses `PCRE`_. A regular
   expression retrieved from the server may not compile in
   Python, or may match a different set of strings in Python than
   when used in a MongoDB query. :meth:`try_compile()` may raise
   :exc:`re.error`.

.. _PCRE: http://www.pcre.org/
)r   compiler4   r&   rP   s   &r   try_compileRegex.try_compilex   s     zz$,,

33r   )r&   r4   rO   )r   )__name__
__module____qualname____firstlineno____doc__	__slots__r	   __getstate__r
   __setstate___type_markerclassmethodr5   r<   rF   __hash__rJ   rQ   rV   __static_attributes__r   r   r   r*   r*   .   sQ    '$I"L"LL1 18S*" H!:4 4r   r*   )r\   
__future__r   r   typingr   r   r   r   r   r   bson._helpersr	   r
   bson.sonr   r'   r   r:   r(   r*   r   r   r   <module>rh      sC    : " 	 > > : $ T3W4GBK W4r   