mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-22 17:32:43 +00:00
You need to escape backslashes
This commit is contained in:
1 parent
47f82e4408
commit
a284ad4092
1 file changed
+2
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user