<div dir="ltr"><div><div><div><div>Hi Daniel,<br></div>Thank you for your hint.<br></div>I will continuing investigating and try to reach my goal.<br></div><br>Best regards<br></div>José<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-02 14:29 GMT+00:00 Daniel Tryba <span dir="ltr"><<a href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 01, 2017 at 04:58:00PM +0000, José Seabra wrote:<br>
> #015#012Calling-Name-Status: available#015#012Calling-Name: "josé" <<br>
> <a href="mailto:sip%3A5555555552@10.10.10.10">sip:5555555552@10.10.10.10</a>>#<wbr>015#012Presentation-Indicator: allowed#015#012<br>
><br>
> The Kamailio re.subst function is constructed as the following:<br>
><br>
> $sht(cnam=>$ci::calling_name)=<wbr>$(var(rb){re.subst,/(.*)<wbr>Calling-Name:<br>
> ?([\W|0-9A-Za-z_]{5,500} ?[<>:@.|0-9A-Za-z_]{5,500})(.*<wbr>)$/\2/s});<br>
><br>
> The issue here is that this re.subst function doesn't match the accents, I<br>
> have tested this regex on <a href="http://regex101.com" rel="noreferrer" target="_blank">regex101.com</a> and it does match. My question is<br>
> how i can get the same result with re.subst?<br>
> Anyone can help?<br>
<br>
</span>Maybe <a href="http://regexo101.com" rel="noreferrer" target="_blank">regexo101.com</a> is wrong? \W is ^\w, \w contains [A-Za-z0-9_] but<br>
depending on the lib might include much more like latin or UTF8. So if é<br>
matches \w in kamailio but obviuosly never matches [A-Za-z0-9_], the é<br>
doesn't match \W and thus "josé" doesn't match the minimum 5 chars.<br>
<br>
[\W|\w]{5,500} would match, but that looks the same as .{5,500}<br>
<br>
Never looked whether kamailio supports it but there is something that<br>
matches non ascii word characters in regexp libs:<br>
<a href="http://www.regular-expressions.info/unicode.html" rel="noreferrer" target="_blank">http://www.regular-<wbr>expressions.info/unicode.html</a><br>
<br>
______________________________<wbr>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cumprimentos<div>José Seabra</div></div>
</div>