<div dir="ltr"><div>Hi OpenSIPS community!</div><div>I've come across one small obstacle, when trying to use pseudo variables</div><div>or attribute value pairs in regular expression.</div><div><br></div><div>I believe my mistake should be quite simple.</div><div><br></div><div>Regular expression is used in a condition:<br>if ( $rU =~ "^$var(each)" )</div><div><br></div><div>$var(each) - is a string variable, not integer. It contains certain prefix, like "44".<br></div><div><br></div><div>For some reason OpenSIPS script is not able to get through this check properly.</div><div>But, in case I hardcode something like this:</div><div>if ( $rU =~ "^44" )</div><div>then it passes a check as needed.<br></div><div><br></div><div>To my shame, I spent several hours trying to solve this in different ways, but without any success.</div><div><br></div><div>I think that the problem consists of extra quotes appearing when $var(each) comes into play.</div><div>So I have first quoting defined in a condition, they wrap regular exp: ^$var(each)<br></div><div>And when $var(each) is defined in a condition, it gets quotes too, since it's a string.<br></div><div><br></div><div>Of course I can use some other way to run this check, for example with help of regex module.</div><div>But my curiosity doesn't give me any chance to set this case aside.<br></div><div><br></div><div>Any advice is appreciated!</div><div><br></div><div><span style="color:rgb(0,0,0)">-- <br></span><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span style="color:rgb(0,0,0)"><br></span></div><div dir="ltr"><div dir="ltr"><span style="color:rgb(0,0,0)"><font style="background-color:rgb(255,255,255)">Best regards,<br></font></span></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394"><span style="color:rgb(0,0,0)">Donat Zenichev</span><br><br></font></div></div></div></div></div></div></div></div></div></div>