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()
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 eithertest1
ortest2
but would instead match any string that starts withtest1
or ends withtest2
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()