Skip to content
Permalink
Browse files

Fix regexp_substr expression to correctly return only first matched g…

…roup, not entire matched string
  • Loading branch information
nyalldawson committed Aug 8, 2013
1 parent 33c288a commit 41f8abb15900f1cdd68888851abeca1602d667d0
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgsexpression.cpp
@@ -688,7 +688,7 @@ static QVariant fcnRegexpSubstr( const QVariantList& values, const QgsFeature* ,
if ( re.captureCount() > 0 )
{
// return first capture
return QVariant( re.capturedTexts()[0] );
return QVariant( re.capturedTexts()[1] );
}
else
{
@@ -1661,7 +1661,7 @@ bool QgsExpression::needsGeometry()

void QgsExpression::initGeomCalculator()
{
if( mCalc )
if ( mCalc )
return;

// Use planimetric as default
@@ -1671,7 +1671,7 @@ void QgsExpression::initGeomCalculator()

void QgsExpression::setGeomCalculator( QgsDistanceArea &calc )
{
if( !mCalc )
if ( !mCalc )
mCalc = new QgsDistanceArea();

// Copy from supplied calculator

0 comments on commit 41f8abb

Please sign in to comment.
You can’t perform that action at this time.