python-hyperscan
python-hyperscan copied to clipboard
Add args for early termination of scanning if only need to find one match regex or just judging matched
Thanks for your excellent work!
And here is some using case to improve
I'm catching hyperscan.ScanTerminated to break scan if I return True and raise HS_SCAN_TERMINATED error in callback func match_event_handler. Which can early termination of scanning if I only want to know is matched but don't care whitch regex is mtached.
It can be achieved by catching hyperscan.ScanTerminated or modify Database_scan in hyperscanmodule.c by judging HS_SCAN_TERMINATED and HS_SUCCESS.