escape () in field search

This commit is contained in:
Damien Elmes 2012-11-06 08:37:38 +09:00
parent 36f5fd0e4c
commit 320cf05a51

View file

@ -406,7 +406,7 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds
# nothing has that field
return
# gather nids
regex = val.replace("_", ".").replace("%", ".*")
regex = re.escape(val).replace("\\_", ".").replace("\\%", ".*")
nids = []
for (id,mid,flds) in self.col.db.execute("""
select id, mid, flds from notes