L235 / hat-collector

GNU General Public License v2.0
0 stars 4 forks source link

group regex rule before modification #32

Closed PhantomTech closed 2 years ago

PhantomTech commented 2 years ago

Prevents a bug causing rules to behave unexpectedly if not first grouped by the user.

For example, the rule test1|test2 would be expected to match only strings that are entirely equal to either test1 or test2 but would instead match any string that starts with test1 or ends with test2 because the rule would be converted to the regex ^test1|test2$

An alternative suggested by Tamzin is to remove the rule modification and use fullmatch() instead of search()

L235 commented 2 years ago

Thanks @PhantomTech and @TamzinHadasa.

L235 commented 2 years ago

Deployed.