From a284ad4092871d55dfb213398d5a1994bb666a78 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 18 Jan 2016 17:20:44 +0000 Subject: [PATCH] You need to escape backslashes --- synapse/push/push_rule_evaluator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index 86d8ac5c4f..2524922131 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -274,7 +274,7 @@ def _glob_matches(glob, value, word_boundary=False): r, ) if word_boundary: - r = "\b%s\b" % (r,) + r = r"\b%s\b" % (r,) r = re.compile(r, flags=re.IGNORECASE) return r.search(value) @@ -285,7 +285,7 @@ def _glob_matches(glob, value, word_boundary=False): return r.match(value) elif word_boundary: r = re.escape(glob) - r = "\b%s\b" % (r,) + r = r"\b%s\b" % (r,) r = re.compile(r, flags=re.IGNORECASE) return r.search(value)