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.
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 raiseHS_SCAN_TERMINATED
error in callback funcmatch_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 catchinghyperscan.ScanTerminated
or modifyDatabase_scan
inhyperscanmodule.c
by judgingHS_SCAN_TERMINATED
andHS_SUCCESS
.