[OpenSIPS-Users] re.subst usage

Liviu Chircu liviu at opensips.org
Wed Jul 29 13:14:05 EST 2020


On 29.07.2020 15:44, Barnaby Ritchley wrote:
> With $rU of 12345441234567890 we would expect $var(to_user) to be 
> 441234567890 (stripping off the first 5 digits) however 
> $var(to_user) returns 12345441234567890
> What am I doing wrong?
>
Hey Barnaby,

I would guess that the PCRE library does not support the "\d" literal, 
which also seems to be confirmed by this site [1].  The 
"/\+?[0-9]{5}([1-9][0-9]+)/\1/g" regexp should remove your tech prefix 
as expected.

BR,

[1]: https://www.regular-expressions.info/shorthand.html

-- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit 2020 Distributed
   www.opensips.org/events/Summit-2020Distributed

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200729/27515835/attachment-0001.html>


More information about the Users mailing list