o (]^Ñã@s‚ddlZddlmZmZddlmZddlmZddlm Z dZ dZ dZ Gd d „d ee ƒZd ee ee fd e e fd d„ZdS)éN)ÚPatternÚUnion)Ú BaseMatcher)Ú Description)ÚMatcherz Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtc@s:eZdZd dd„Zdeddfdd„Zdedefd d „ZdS) ÚStringMatchesPatternÚreturnNcCs ||_dS©N©Úpattern)Úselfr ©r úE/usr/lib/python3/dist-packages/hamcrest/library/text/stringmatches.pyÚ__init__s zStringMatchesPattern.__init__Ú descriptioncCs| d¡ |jj¡ d¡dS)Nza string matching 'ú')Ú append_textr )r rr r rÚ describe_tos ÿ z StringMatchesPattern.describe_toÚitemcCs|j |¡duSr )r Úsearch)r rr r rÚ_matchesszStringMatchesPattern._matches)rN) Ú__name__Ú __module__Ú __qualname__rrrÚstrÚboolrr r r rr s rr rcCst|tƒr t |¡}t|ƒS)aKMatches 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Úcompilerr r r rÚmatches_regexps r)rÚtypingrrÚhamcrest.core.base_matcherrÚhamcrest.core.descriptionrÚhamcrest.core.matcherrÚ __author__Ú __copyright__Ú __license__rrrr r r rÚs   &