diff --git a/beets/library.py b/beets/library.py index ef7af6dd2..f2aebcbd7 100644 --- a/beets/library.py +++ b/beets/library.py @@ -425,7 +425,7 @@ class RegexpQuery(FieldQuery): def match(self, item): value = getattr(item, self.field) or '' - return self.regexp.match(value) is not None + return self.regexp.search(value) is not None class BooleanQuery(MatchQuery): """Matches a boolean field. Pattern should either be a boolean or a @@ -476,24 +476,28 @@ class CollectionQuery(Query): subvals += subq_subvals clause = (' ' + joiner + ' ').join(clause_parts) return clause, subvals - - # regular expression for _parse_query_part, below - _pq_regex = re.compile(# non-grouping optional segment for the keyword - r'(?:' - r'(\S+?)' # the keyword - r'(?