Match a single regex pattern synchronously (runs in a thread pool).
(self, rule, document)
| 41 | return [match for match in results if match] |
| 42 | |
| 43 | def match_pattern(self, rule, document): |
| 44 | """Match a single regex pattern synchronously (runs in a thread pool).""" |
| 45 | matches = [ |
| 46 | {'rule_name': rule['name'], 'rule_id': rule['id'], 'match': m.group(), 'start': m.start(), 'end': m.end()} |
| 47 | for m in rule['pattern'].finditer(document) |
| 48 | ] |
| 49 | return matches if matches else None |
| 50 | |
| 51 | |
| 52 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected