hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

Free-spacing (x modifier) support?

Open eliaslevy opened this issue 6 years ago • 4 comments

Is free-spacing support in the roadmap per chance?

eliaslevy avatar Dec 22 '19 04:12 eliaslevy

x modifier is already supported by Hyperscan

xiangwang1 avatar Dec 23 '19 01:12 xiangwang1

Thanks. It appears that it is supported as an inline option modifier ((?x)), but not as a flag (HS_FLAG_*). Is there a reason for that?

eliaslevy avatar Dec 26 '19 18:12 eliaslevy

HS_FLAG_* flags are used to support most frequent used modifiers based on customers' request. Given limited usage of x modifier in real networking systems, we don't explicitly define it with HS_FLAG_*. Do you have any specific use case that is highly depending on this modifier?

xiangwang1 avatar Dec 30 '19 02:12 xiangwang1

We use Hyperscan to evaluate the regular expressions in a language we developed, in which we allow the use of the x flag to make the regexs more readable. In the language the regexs are expressed in the usual syntax (e.g. /foo.*/ix). We translate the expression flags to HS_FLAG_* flags, but a HS_FLAG_* for x is missing. It is easy enough to prepend the expression with the inline option modifier if we see the x flag, but for completeness it seems there should be a HS_FLAG_* for it.

eliaslevy avatar Dec 30 '19 19:12 eliaslevy