mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -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):
|
||||
"Delete tags if they exist."
|
||||
def wildcard(pat, str):
|
||||
return '*' in pat and re.search(
|
||||
pat.replace('*', '.*'), str, re.IGNORECASE)
|
||||
pat = re.escape(pat).replace('\\*', '.*')
|
||||
return '*' in pat and re.search(pat, str, re.IGNORECASE)
|
||||
currentTags = self.split(tags)
|
||||
for tag in self.split(deltags):
|
||||
# find tags, ignoring case
|
||||
|
|
Loading…
Reference in a new issue