diff options
Diffstat (limited to 'src/search')
| -rw-r--r-- | src/search/dolphinquery.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/search/dolphinquery.cpp b/src/search/dolphinquery.cpp index 0581a02ec..663ed9909 100644 --- a/src/search/dolphinquery.cpp +++ b/src/search/dolphinquery.cpp @@ -59,7 +59,11 @@ namespace { QStringList splitOutsideQuotes(const QString& text) { - const QRegularExpression subTermsRegExp("(\\S*?\"[^\"]*?\"|(?<=\\s|^)\\S+(?=\\s|$))"); + // Match groups on 3 possible conditions: + // - Groups with two leading quotes must close both on them (filename:""abc xyz" tuv") + // - Groups enclosed in quotes + // - Words separated by spaces + const QRegularExpression subTermsRegExp("(\\S*?\"\"[^\"]+\"[^\"]+\"+|\\S*?\"[^\"]+\"+|(?<=\\s|^)\\S+(?=\\s|$))"); auto subTermsMatchIterator = subTermsRegExp.globalMatch(text); QStringList textParts; |
