Matches the string with the pattern, caching the compiled regexp.
(pattern, s)
| 407 | linenum in _error_suppressions.get(None, set())) |
| 408 | |
| 409 | def Match(pattern, s): |
| 410 | """Matches the string with the pattern, caching the compiled regexp.""" |
| 411 | # The regexp compilation caching is inlined in both Match and Search for |
| 412 | # performance reasons; factoring it out into a separate function turns out |
| 413 | # to be noticeably expensive. |
| 414 | if not pattern in _regexp_compile_cache: |
| 415 | _regexp_compile_cache[pattern] = sre_compile.compile(pattern) |
| 416 | return _regexp_compile_cache[pattern].match(s) |
| 417 | |
| 418 | |
| 419 | def Search(pattern, s): |
no outgoing calls
no test coverage detected