Closed ituronova closed 2 years ago
I am using a script: https://github.com/intel/hyperscan/blob/master/examples/simplegrep.c to match a regular expression in an input text.
I would like to search each line of the input text, however, I want stop searching in a line after the first match occurs. I would like to get a number of lines with a match as soon as possible.
It is possible to somehow modify the script to do so?
Thank you.
You can try HS_FLAG_SINGLEMATCH for your rule, just refer to this link Pattern flags
HS_FLAG_SINGLEMATCH
I am using a script: https://github.com/intel/hyperscan/blob/master/examples/simplegrep.c to match a regular expression in an input text.
I would like to search each line of the input text, however, I want stop searching in a line after the first match occurs. I would like to get a number of lines with a match as soon as possible.
It is possible to somehow modify the script to do so?
Thank you.