]> git.cworth.org Git - notmuch/blobdiff - lib/regexp-fields.cc
lib: do not phrase parse prefixed bracketed subexpressions
[notmuch] / lib / regexp-fields.cc
index 7e9d959c9b0bc15ffc5b10a9754246750384e668..539915d892f9529d3d011dfa7611bb37aba718d2 100644 (file)
@@ -227,7 +227,8 @@ RegexpFieldProcessor::operator() (const std::string & str)
             * phrase parsing, when possible */
            std::string query_str;
 
-           if (*str.rbegin () != '*' || str.find (' ') != std::string::npos)
+           if ((str.at (0) != '(' || *str.rbegin () != ')') &&
+               (*str.rbegin () != '*' || str.find (' ') != std::string::npos))
                query_str = '"' + str + '"';
            else
                query_str = str;