On 9/23/10 9:46 AM, Andrei Pelinescu-Onciul wrote:
On Sep 22, 2010 at 22:25, Iñaki Baz Castillo<i...@aliax.net>  wrote:
2010/9/22 marius zbihlei<marius.zbih...@1and1.ro>:
this will be much better handled by a transformation

if ( $(fn{s.len})>  62 ) {...}
Yes, using pcre_math is good when we need to perform a regular
expression against a PV (which is not possible using "=~"). For
example I use it to check if the RURI username matches a prefix
extracted from a database:

   if ! pcre_match("$rU", "^$var(client_prefix_in)") {

This works because the regular expression is compiled in runtime.


This would not be possible with "=~":

   if  !  $rU =~ "^$var(client_prefix_in)") {

It fails because the regular expression is compiled when parsing the
config script.
With sr/ser/kamailio 3.x it should work.
E.g.:
$foo="test2";
if ($foo =~ "^tes"+"t["+1+"2]$")
  ...

but can it be a variable in the right side? E.g.,

$bar="^tes"+"t["+1+"2]$";
if($foo =~ $bar) {

Cheers,
Daniel

--
Daniel-Constantin Mierla
http://www.asipto.com


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to