Hi Devs,

I'd like to know if an escape character is defined for the LIKE operator in QGIS Expression.

If I take a look at the code src/core/qgsexpression.cpp:4343 no escape char is used
```
if ( mOp == boLike || mOp == boILike || mOp == boNotLike || mOp == boNotILike ) // change from LIKE syntax to regexp
        {
          QString esc_regexp = QRegExp::escape( regexp );
          // XXX escape % and _  ???
          esc_regexp.replace( '%', ".*" );
          esc_regexp.replace( '_', '.' );
matches = QRegExp( esc_regexp, mOp == boLike || mOp == boNotLike ? Qt::CaseSensitive : Qt::CaseInsensitive ).exactMatch( str );
        }
```
Do you think we have to add one ?

Regards,
René-Luc
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to