Hi, Kamailio uses the following syntax for =~ operator:
if ( $rU =~ "^2[0-9]{2}$" ) {
Reading the SR commits, it seems that SR will support regular
expressions in 'switch' stament:
switch ($rU) {
case 200: # INTEGER
[...]
case "alice": # STRING
[...]
case /2[0-9]{2}/: # REGULAR EXPRESSION
[...]
}
If the above is correct, it requires two different syntax for a
regular expression:
a) =~ "^2[0-9]{2}$"
b) case /2[0-9]{2}/:
Wouldn't make sense to have an unique syntax for regular expressions?
IMHO the best one is:
/2[0-9]{2}/
so =~ would use:
if ( $rU =~ /^2[0-9]{2}$/ ) {
Opinions? Regards.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>