MCPcopy
hub / github.com/anthropics/claude-code / compile_regex

Function compile_regex

plugins/hookify/core/rule_engine.py:15–24  ·  view source on GitHub ↗

Compile regex pattern with caching. Args: pattern: Regex pattern string Returns: Compiled regex pattern

(pattern: str)

Source from the content-addressed store, hash-verified

13# Cache compiled regexes (max 128 patterns)
14@lru_cache(maxsize=128)
15def compile_regex(pattern: str) -> re.Pattern:
16 """Compile regex pattern with caching.
17
18 Args:
19 pattern: Regex pattern string
20
21 Returns:
22 Compiled regex pattern
23 """
24 return re.compile(pattern, re.IGNORECASE)
25
26
27class RuleEngine:

Callers 1

_regex_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected