The reason why your second regular expression is not matching the pattern is because of a typo in the syntax. You have used the ~= operator instead of the =~ operator, which is the correct way to test if a string matches a regular expression in PCRE.
Op di 2 jan 2024 om 12:28 schreef Faheem Muhammad <[email protected]>: > Hi everyone, > > Firstly, I wish you all a Happy New Year with the best wishes for each > community member and the OpenSIPS project. > > I have a question related to regular expressions matching in an IF > condition. > There are two identical regular expressions. One RE is matching and one RE > is not matching the pattern. > > *Sample $fU Range: *+966123456700 to +96612345650 > > # RE1 - Matching Regular expression > if($fU =~"\+9661234567[0-4][0-9]|\+966123456750"){ > xlog("re matched\n") > } > > # RE2 - Non matching Regular expression > if($fU ~="\+9661234567([0-4]\d|50)"){ > } # RE not matched > > Can anyone please suggest what I'm doing wrong? > > *OpenSIPS version*: 3.2.3 > OS: *Debian 12* > > > Best regards, > M. Faheem > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users >
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
