Check if pattern matches text using regex. Args: pattern: Regex pattern text: Text to match against Returns: True if pattern matches
(self, pattern: str, text: str)
| 254 | return None |
| 255 | |
| 256 | def _regex_match(self, pattern: str, text: str) -> bool: |
| 257 | """Check if pattern matches text using regex. |
| 258 | |
| 259 | Args: |
| 260 | pattern: Regex pattern |
| 261 | text: Text to match against |
| 262 | |
| 263 | Returns: |
| 264 | True if pattern matches |
| 265 | """ |
| 266 | try: |
| 267 | # Use cached compiled regex (LRU cache with max 128 patterns) |
| 268 | regex = compile_regex(pattern) |
| 269 | return bool(regex.search(text)) |
| 270 | |
| 271 | except re.error as e: |
| 272 | print(f"Invalid regex pattern '{pattern}': {e}", file=sys.stderr) |
| 273 | return False |
| 274 | |
| 275 | |
| 276 | # For testing |
no test coverage detected