<p dir="ltr">Or we could upgrade regex_match() to return an offset instead of a binary false / true. </p>
<div class="gmail_extra"><br><div class="gmail_quote">On Nov 7, 2016 7:17 PM, "Matthias Kuhn" <<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I haven't found any existing functionality. regexp_pos?<br>
<div class="quoted-text"><br>
On 11/07/2016 01:12 PM, Mathieu Pellerin wrote:<br>
> I ll take care of this over the weekend. What should the regexp function<br>
> be called?<br>
><br>
><br>
> On Nov 7, 2016 7:10 PM, "Mathieu Pellerin" <<a href="mailto:nirvn.asia@gmail.com">nirvn.asia@gmail.com</a><br>
</div><div class="quoted-text">> <mailto:<a href="mailto:nirvn.asia@gmail.com">nirvn.asia@gmail.com</a>>> wrote:<br>
><br>
>     You read my mind. Big +1 from me.<br>
><br>
><br>
>     On Nov 7, 2016 6:40 PM, "Matthias Kuhn" <<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a><br>
</div><div class="quoted-text">>     <mailto:<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a>>> wrote:<br>
><br>
>         I wonder if we should change this for QGIS 3.0 and use<br>
>         QString::indexOf<br>
>         instead, while providing dedicated regexp functions.<br>
><br>
>         What do you think, Mathieu?<br>
><br>
>         Matthias<br>
><br>
>         On 11/07/2016 12:26 PM, Mathieu Pellerin wrote:<br>
>         > We should indicate in the function help that strpos is regexp<br>
>         based.<br>
>         ><br>
>         ><br>
>         > On Nov 7, 2016 6:23 PM, "Matthias Kuhn" <<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a><br>
>         <mailto:<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a>><br>
</div><div class="elided-text">>         > <mailto:<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a> <mailto:<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a>>>> wrote:<br>
>         ><br>
>         >     Hi,<br>
>         ><br>
>         >     strpos is based on regexp, a '.' matches any character.<br>
>         >     To let the engine treat a . as such you need to prefix it<br>
>         with a<br>
>         >     double-backslash.<br>
>         ><br>
>         >     strpos(to_string("area"), '\\.')<br>
>         ><br>
>         >     Regards<br>
>         >     Matthias<br>
>         ><br>
>         ><br>
>         >     On 11/07/2016 12:07 PM, Elstermann, Mike wrote:<br>
>         >     > Hi,<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > “area” is a double-field with values e. g. 213.1234,<br>
>         43215.3456, …<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > strpos("area",'.') gives only value 1 return :-(<br>
>         >     ><br>
>         >     > strpos(to_string("area"),'.') gives only value 1 return  :-(<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > This error exits only by ‘.’, other search-strings e. g.<br>
>         ‘12’, ‘1’, …<br>
>         >     > work fine<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > Our workarround works fine.<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > strpos( replace( to_string( "area" ), '.', ',' ), ',' )<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > Is this a bug with ‘.’?<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > best regards, mikeE.<br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     ><br>
>         >     > ______________________________<wbr>_________________<br>
>         >     > Qgis-developer mailing list<br>
>         >     > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a>><br>
</div>>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a><br>
<div class="quoted-text">>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a>>><br>
>         >     > List info:<br>
>         <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>><br>
>         >     <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>>><br>
>         >     > Unsubscribe:<br>
>         >     <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>><br>
>         >     <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>>><br>
>         >     ><br>
>         >     ______________________________<wbr>_________________<br>
>         >     Qgis-developer mailing list<br>
>         >     <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a>><br>
</div>>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a><br>
<div class="quoted-text">>         <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.<wbr>osgeo.org</a>>><br>
>         >     List info:<br>
>         <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>><br>
>         >     <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>>><br>
>         >     Unsubscribe:<br>
>         <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>><br>
</div>>         >     <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
>         <<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a>>><br>
>         ><br>
><br>
</blockquote></div><br></div>