From 640c4ff7848ffc7944b970f480dc493a4f4e1060 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 19 Apr 2011 15:02:37 +0100 Subject: [PATCH] Fix non-escaped '|' when searching for commas in authors using REGEXP_MATCH --- src/calibre/library/caches.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 9523795f28..92c5ca9b3c 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -707,7 +707,10 @@ class ResultCache(SearchQueryParser): # {{{ for loc in location: # location is now an array of field indices if loc == db_col['authors']: ### DB stores authors with commas changed to bars, so change query - q = query.replace(',', '|'); + if matchkind == REGEXP_MATCH: + q = query.replace(',', r'\|'); + else: + q = query.replace(',', '|'); else: q = query