<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi devs,<br>
<br>
I have opened a PR <a class="moz-txt-link-freetext" href="https://github.com/qgis/QGIS/pull/3535">https://github.com/qgis/QGIS/pull/3535</a><br>
Reviews are welcome<br>
<br>
<div class="moz-cite-prefix">Le 24/09/2016 à 05:27, Nathan Woodrow a
écrit :<br>
</div>
<blockquote
cite="mid:CAAi8Yg8tE9oyjO9K6GdSbGKADO-MyszQucgRQh24X16D8AVL6g@mail.gmail.com"
type="cite">
<div dir="ltr">Hey,
<div><br>
</div>
<div>When would you normally need an escape char for LIKE?</div>
<div><br>
</div>
<div>- Nathan </div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Sep 23, 2016 at 6:33 PM,
René-Luc Dhont <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:rldhont@gmail.com" target="_blank">rldhont@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Devs,<br>
<br>
I'd like to know if an escape character is defined for the
LIKE operator in QGIS Expression.<br>
<br>
If I take a look at the code src/core/qgsexpression.cpp:434<wbr>3
no escape char is used<br>
```<br>
if ( mOp == boLike || mOp == boILike || mOp ==
boNotLike || mOp == boNotILike ) // change from LIKE syntax
to regexp<br>
{<br>
QString esc_regexp = QRegExp::escape( regexp );<br>
// XXX escape % and _ ???<br>
esc_regexp.replace( '%', ".*" );<br>
esc_regexp.replace( '_', '.' );<br>
matches = QRegExp( esc_regexp, mOp == boLike ||
mOp == boNotLike ? Qt::CaseSensitive : Qt::CaseInsensitive
).exactMatch( str );<br>
}<br>
```<br>
Do you think we have to add one ?<br>
<br>
Regards,<br>
René-Luc<br>
______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a moz-do-not-send="true"
href="mailto:Qgis-developer@lists.osgeo.org"
target="_blank">Qgis-developer@lists.osgeo.org</a><br>
List info: <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/qgis-developer"
rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman<wbr>/listinfo/qgis-developer</a><br>
Unsubscribe: <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/qgis-developer"
rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman<wbr>/listinfo/qgis-developer</a></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>