aboutsummaryrefslogtreecommitdiff
path: root/find-modules/rules_engine.py
diff options
context:
space:
mode:
Diffstat (limited to 'find-modules/rules_engine.py')
-rwxr-xr-xfind-modules/rules_engine.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/find-modules/rules_engine.py b/find-modules/rules_engine.py
index 9c617159..8ec5ac5c 100755
--- a/find-modules/rules_engine.py
+++ b/find-modules/rules_engine.py
@@ -80,7 +80,10 @@ class Rule(object):
try:
groups = ["(?P<{}>{})".format(name, pattern) for pattern, name in pattern_zip]
groups = _SEPARATOR.join(groups)
- self.matcher = re.compile(groups)
+ #
+ # We'll use re.match to anchor the start of the match, and so need a $ to anchor the end.
+ #
+ self.matcher = re.compile(groups + "$")
except Exception as e:
groups = ["{} '{}'".format(name, pattern) for pattern, name in pattern_zip]
groups = ", ".join(groups)