mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Escape unsupported regex chars
This commit is contained in:
parent
12c98a21f0
commit
dee0fe2880
1 changed files with 2 additions and 2 deletions
|
@ -141,8 +141,8 @@ class TagManager:
|
||||||
def remFromStr(self, deltags, tags):
|
def remFromStr(self, deltags, tags):
|
||||||
"Delete tags if they exist."
|
"Delete tags if they exist."
|
||||||
def wildcard(pat, str):
|
def wildcard(pat, str):
|
||||||
return '*' in pat and re.search(
|
pat = re.escape(pat).replace('\\*', '.*')
|
||||||
pat.replace('*', '.*'), str, re.IGNORECASE)
|
return '*' in pat and re.search(pat, str, re.IGNORECASE)
|
||||||
currentTags = self.split(tags)
|
currentTags = self.split(tags)
|
||||||
for tag in self.split(deltags):
|
for tag in self.split(deltags):
|
||||||
# find tags, ignoring case
|
# find tags, ignoring case
|
||||||
|
|
Loading…
Reference in a new issue