Matches the string with the pattern, caching the compiled regexp.
(pattern, s)
| 517 | linenum in _error_suppressions.get(None, set())) |
| 518 | |
| 519 | def Match(pattern, s): |
| 520 | """Matches the string with the pattern, caching the compiled regexp.""" |
| 521 | # The regexp compilation caching is inlined in both Match and Search for |
| 522 | # performance reasons; factoring it out into a separate function turns out |
| 523 | # to be noticeably expensive. |
| 524 | if pattern not in _regexp_compile_cache: |
| 525 | _regexp_compile_cache[pattern] = sre_compile.compile(pattern) |
| 526 | return _regexp_compile_cache[pattern].match(s) |
| 527 | |
| 528 | |
| 529 | def ReplaceAll(pattern, rep, s): |
no outgoing calls
no test coverage detected