summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index 58c8cf700b..6f143a5df9 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -154,7 +154,7 @@ class Pusher(object):
             val = _value_for_dotted_key(condition['key'], ev)
             if val is None:
                 return False
-            return re.match(r, val, flags=re.IGNORECASE) != None
+            return re.search(r, val, flags=re.IGNORECASE) is not None
 
         elif condition['kind'] == 'device':
             if 'profile_tag' not in condition:
@@ -170,8 +170,8 @@ class Pusher(object):
                 return False
             if not display_name:
                 return False
-            return re.match("\b%s\b" % re.escape(display_name),
-                            ev['content']['body'], flags=re.IGNORECASE) != None
+            return re.search("\b%s\b" % re.escape(display_name),
+                            ev['content']['body'], flags=re.IGNORECASE) is not None
 
         elif condition['kind'] == 'room_member_count':
             if 'is' not in condition: