Skip to content

Commit 2e1eb25

Browse files
author
jef
committed
fix #2007
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11804 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7a9c936 commit 2e1eb25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/qgssearchtreenode.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
251251
case opRegexp:
252252
case opLike:
253253
{
254-
if ( !getValue( value1, mLeft, fields, attributes ) || !getValue( value2, mRight, fields, attributes ) )
254+
if ( !getValue( value1, mLeft, fields, attributes ) ||
255+
!getValue( value2, mRight, fields, attributes ) )
255256
return false;
256257

257258
// value1 is string to be matched
@@ -274,10 +275,10 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
274275
}
275276

276277
QRegExp re( str );
277-
res = re.indexIn( value1.string() );
278+
res = re.exactMatch( value1.string() );
278279
QgsDebugMsgLevel( "REGEXP: " + str + " ~ " + value2.string(), 2 );
279280
QgsDebugMsgLevel( " res: " + res, 2 );
280-
return ( res != -1 );
281+
return res;
281282
}
282283

283284
default:

0 commit comments

Comments
 (0)