diff --git a/ftshelpers.cc b/ftshelpers.cc index 4b3c23c8..17e3e69a 100644 --- a/ftshelpers.cc +++ b/ftshelpers.cc @@ -42,6 +42,7 @@ bool parseSearchString( QString const & str, QStringList & indexWords, QRegExp spacesRegExp( "\\W+" ); QRegExp wordRegExp( QString( "\\w{" ) + QString::number( FTS::MinimumWordSize ) + ",}" ); QRegExp setsRegExp( "\\[[^\\]]+\\]", Qt::CaseInsensitive, QRegExp::RegExp2 ); + QRegExp regexRegExp( "\\\\[afnrtvdDwWsSbB]|\\\\x([0-9A-Fa-f]{4})|\\\\0([0-7]{3})", Qt::CaseSensitive, QRegExp::RegExp2 ); hasCJK = false; for( int x = 0; x < str.size(); x++ ) @@ -100,6 +101,10 @@ bool parseSearchString( QString const & str, QStringList & indexWords, QString tmp = str; + // Remove RegExp commands + if( searchMode == FTS::RegExp ) + tmp.replace( regexRegExp, " " ); + // Remove all symbol sets tmp.replace( setsRegExp, " " );