summary refs log tree commit diff
path: root/synapse/push/push_rule_evaluator.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-18 17:20:44 +0000
committerErik Johnston <erik@matrix.org>2016-01-18 17:20:44 +0000
commita284ad4092871d55dfb213398d5a1994bb666a78 (patch)
tree0e359a7f69a4440eada9bd654198cd66cd4e61f1 /synapse/push/push_rule_evaluator.py
parentFix branch didn't check word_boundary (diff)
downloadsynapse-a284ad4092871d55dfb213398d5a1994bb666a78.tar.xz
You need to escape backslashes
Diffstat (limited to 'synapse/push/push_rule_evaluator.py')
-rw-r--r--synapse/push/push_rule_evaluator.py4
1 files 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)