[Kamailio-Users] PCRE Regex / Transformations Bug?

Iñaki Baz Castillo ibc at aliax.net
Wed Dec 23 08:29:29 CET 2009


El Miércoles, 23 de Diciembre de 2009, Brandon Armstead escribió:
> Hello,
> 
>    I'm attempting to use the following in Kamailio:
> $(hdr(from){re.subst,/(.*?);(.*)/\1/}) --- however it does not match /
> replace, with this from header sample:
> 
> From: <sip:714364XXXX at XX.XX.XX.XX
> ;pstn-params=808282808882;cpc=unknown>;tag=gK0b53f6d9
> 
> However if this is fully pcre compatible, then I am a bit lost as I've
> checked the results in php, perl, and python produces:
> 
> From: <sip:714364XXXX at XX.XX.XX.XX (expected result)
> 
> However, Kamailio does not match / replace / etc using the following:
> xlog("L_INFO", "Test From Header Regex:
> $(hdr(from){re.subst,/(.*?);(.*)/\1/})");

You are right. However, could you try by replacing "(.*?)" with "([^;]*)" ?
The result should be the same.

I suspect that "*?" is not supported in Kamailio regular expressions.
  



-- 
Iñaki Baz Castillo <ibc at aliax.net>



More information about the Users mailing list