mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 16:02:15 +01:00
You need to escape backslashes
This commit is contained in:
parent
47f82e4408
commit
a284ad4092
1 changed files with 2 additions and 2 deletions
|
@ -274,7 +274,7 @@ def _glob_matches(glob, value, word_boundary=False):
|
||||||
r,
|
r,
|
||||||
)
|
)
|
||||||
if word_boundary:
|
if word_boundary:
|
||||||
r = "\b%s\b" % (r,)
|
r = r"\b%s\b" % (r,)
|
||||||
r = re.compile(r, flags=re.IGNORECASE)
|
r = re.compile(r, flags=re.IGNORECASE)
|
||||||
|
|
||||||
return r.search(value)
|
return r.search(value)
|
||||||
|
@ -285,7 +285,7 @@ def _glob_matches(glob, value, word_boundary=False):
|
||||||
return r.match(value)
|
return r.match(value)
|
||||||
elif word_boundary:
|
elif word_boundary:
|
||||||
r = re.escape(glob)
|
r = re.escape(glob)
|
||||||
r = "\b%s\b" % (r,)
|
r = r"\b%s\b" % (r,)
|
||||||
r = re.compile(r, flags=re.IGNORECASE)
|
r = re.compile(r, flags=re.IGNORECASE)
|
||||||
|
|
||||||
return r.search(value)
|
return r.search(value)
|
||||||
|
|
Loading…
Reference in a new issue