[SR-Users] PVs in Regular Expression Transformations

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 12 19:56:13 CEST 2010


Hello,

On 4/12/10 6:14 PM, Juha Heinanen wrote:
> i tried to embed a PV in regex transformation, but didn't get desired
> result.  is it possible or must regex only contain strings.
>    

it supports only strings. The subst expression is pre-compiled at startup.

Some development is required to extend for what you want.

Cheers,
Daniel

> here is an example, where the idea is to strip string "456" from the end
> of string "123456":
>
> 	$var(test) = "123456";
> 	$var(rest) = "456";
> 	$var(test) = $(var(test){re.subst,/^(.*)$var(rest)$/\1/});
> 	xlog("result is $var(test)\n");
>
> unfortunately, the result is 0 rather than "123".
>
> i also tried
>
> $var(test) = $(var(test){re.subst,/^(.*)\$var(rest)$/\1/});
>
> and
>
> $var(test) = $(var(test){re.subst,/^(.*)$(var(rest))$/\1/});
>
> but still 0.
>
> -- juha
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>    

-- 
Daniel-Constantin Mierla * http://www.asipto.com/ * 
http://twitter.com/miconda * 
http://www.linkedin.com/in/danielconstantinmierla




More information about the sr-users mailing list