MCPcopy Create free account
hub / github.com/SpecterOps/DeepPass2 / match_pattern

Method match_pattern

utils/nprules.py:43–49  ·  view source on GitHub ↗

Match a single regex pattern synchronously (runs in a thread pool).

(self, rule, document)

Source from the content-addressed store, hash-verified

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
52if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected