New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding hs_multi_compile and hs_scan functionality #411
Comments
As I know, Hyperscan searches for all patterns simultaneously. It compiles them into a kind of automata. So, if you need to search for multiple patterns in a buffer, you should use hs_multi_compile to compile them into one pattern database and then scan the buffer by hs_scan: one scan for one buffer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am having doubt regarding multiple regex scan.
Let say I have 30 different regex patterns to scan on a single buffer and I compile all of them using hs_multi_compile in single database, then used that database in hs_scan, so will hyperscan scan buffer separately for each pattern , or will it scan complete buffer single time for all pattern. (ps. - Point is how many times buffer will be scanned.)
Also if it scan's separately , then how it will be more effective or efficient than compiling all pattern's separately using hs_compile and then calling hs_scan separately for each pattern.
The text was updated successfully, but these errors were encountered: