
    e                         d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	 dZ
dZdZ G d	 d
ee         Zdeeee   f   de	e   fdZy)    N)PatternUnion)BaseMatcher)Description)Matcherz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtc                   4    e Zd ZddZdeddfdZdedefdZy)	StringMatchesPatternreturnNc                     || _         y Npattern)selfr   s     E/usr/lib/python3/dist-packages/hamcrest/library/text/stringmatches.py__init__zStringMatchesPattern.__init__   s	        descriptionc                     |j                  d      j                  | j                  j                        j                  d       y )Nza string matching '')append_textr   )r   r   s     r   describe_toz StringMatchesPattern.describe_to   s3     56BBLL  	

+c
r   itemc                 <    | j                   j                  |      d uS r   )r   search)r   r   s     r   _matcheszStringMatchesPattern._matches   s    ||""4(44r   )r
   N)	__name__
__module____qualname__r   r   r   strboolr    r   r   r	   r	      s-    { t 
5S 5T 5r   r	   r   r
   c                 b    t        | t              rt        j                  |       } t	        |       S )aK  Matches if object is a string containing a match for a given regular
    expression.

    :param pattern: The regular expression to search for.

    This matcher first checks whether the evaluated object is a string. If so,
    it checks if the regular expression ``pattern`` matches anywhere within the
    evaluated object.

    )
isinstancer   recompiler	   r   s    r   matches_regexpr&      s'     '3**W%((r   )r$   typingr   r   hamcrest.core.base_matcherr   hamcrest.core.descriptionr   hamcrest.core.matcherr   
__author____copyright____license__r   r	   r&   r!   r   r   <module>r.      sY    	 ! 2 1 )
-$
5;s+ 
5)E#ws|"34 ) )r   