Closed PeterBooker closed 10 months ago
@Clorith has pointed out that we should probably add ^
to the front and $
to the back if they do not already exist, which would define the start and end of string in the regex, ensuring that there are no unintended matches.
Fixed by #24
Came across a project where the rule:
"tableName": ".*_woocommerce_gc_cards",
matches both:This is because we currently only check if the given regex has a match inside the table name. This can be resolved by adding a
$
to the end of the tableName regex, e.g..*_woocommerce_gc_cards$
. I think we can update to check whether thetableName
value ends in$
and add it if not. This will ensure that all rules only ever match one table.(props @JorgenStenshaugen)