<div dir="ltr"><div><div><div><div><div>Hi Daniel,<br></div>Just to give you feedback about the way i have implemented this.<br><br></div>I changed the way that i was trying to get it done.<br></div><br>Now I'm using the {line.sw,match} ( you had already mentioned this function on an old email), to split the string by line, then i apply the following regex: ^Calling-Name: ?(.{2,50}>)$.<br><br></div><div>This way I get what i need, that is the sip uri and display name.<br></div><br>Thank you.<br><br></div>José Seabra<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-02 15:28 GMT+00:00 José Seabra <span dir="ltr"><<a href="mailto:joseseabra4@gmail.com" target="_blank">joseseabra4@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div><div class="h5"><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>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" target="_blank">sip:5555555552@10.10.10.10</a>>#01<wbr>5#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,/(.*)Callin<wbr>g-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-expressions<wbr>.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" target="_blank">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/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-7696289193899965480gmail_signature" data-smartmail="gmail_signature">Cumprimentos<div>José Seabra</div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cumprimentos<div>José Seabra</div></div>
</div>