MCPcopy Create free account
hub / github.com/alibaba/GraphScope / Match

Function Match

analytical_engine/misc/cpplint.py:1033–1040  ·  view source on GitHub ↗

Matches the string with the pattern, caching the compiled regexp.

(pattern, s)

Source from the content-addressed store, hash-verified

1031
1032
1033def Match(pattern, s):
1034 """Matches the string with the pattern, caching the compiled regexp."""
1035 # The regexp compilation caching is inlined in both Match and Search for
1036 # performance reasons; factoring it out into a separate function turns out
1037 # to be noticeably expensive.
1038 if pattern not in _regexp_compile_cache:
1039 _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
1040 return _regexp_compile_cache[pattern].match(s)
1041
1042
1043def ReplaceAll(pattern, rep, s):

Callers 15

IsInAlphabeticalOrderMethod · 0.70
CheckMethod · 0.70
CleanseRawStringsFunction · 0.70
_CollapseStringsMethod · 0.70
CloseExpressionFunction · 0.70
GetIndentLevelFunction · 0.70
CheckForHeaderGuardFunction · 0.70
CheckEndMethod · 0.70
CheckEndMethod · 0.70

Calls 2

compileMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected