From 2f74908b25ec80caf3bf498984d4aa409b4012f4 Mon Sep 17 00:00:00 2001 From: Avi Puchalapalli Date: Fri, 25 Sep 2015 11:13:42 -0400 Subject: [PATCH] Update Field Searches to match multi-line fields Currently, field searches are confirmed by a regex search with the single option of case-insensitive (?i), and with the beginning and ending markers ^ and $. Since multi-line is not enabled, and re.DOTALL (option s) is not enabled, the field search will fail for any field with a new line --- anki/find.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anki/find.py b/anki/find.py index d26f243d5..53d0a4f00 100644 --- a/anki/find.py +++ b/anki/find.py @@ -433,7 +433,7 @@ where mid in %s and flds like ? escape '\\'""" % ( ord = mods[str(mid)][1] strg = flds[ord] try: - if re.search("(?i)^"+regex+"$", strg): + if re.search("(?si)^"+regex+"$", strg): nids.append(id) except sre_constants.error: return