mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
re.escape() deck search
This commit is contained in:
parent
63befa7c0c
commit
bdcc8e284b
1 changed files with 1 additions and 3 deletions
|
@ -394,9 +394,7 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds
|
|||
else:
|
||||
# wildcard
|
||||
ids = set()
|
||||
# should use re.escape in the future
|
||||
val = val.replace("*", ".*")
|
||||
val = val.replace("+", "\\+")
|
||||
val = re.escape(val).replace(r"\*", ".*")
|
||||
for d in self.col.decks.all():
|
||||
if re.match("(?i)"+val, d['name']):
|
||||
ids.update(dids(d['id']))
|
||||
|
|
Loading…
Reference in a new issue