Fix bug in full-text search in "RegExp" mode

This commit is contained in:
Abs62 2015-12-31 15:42:33 +03:00
parent 38adb08ea9
commit e037533424

View file

@ -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, " " );