<div class="gmail_quote">2009/2/4 Klaus Darilion <span dir="ltr">&lt;<a href="mailto:klaus.mailinglists@pernau.at">klaus.mailinglists@pernau.at</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
<br>
I am going nuts using REGEXP. I just want to verify if a variable<br>
contains a valid +E164 phone number.<br>
<br>
These, the the pattern is ^\+[0-9]+<br>
<br>
First I tried:<br>
<br>
 &nbsp; Set(pattern=^\+[0-9]+);<br>
 &nbsp; if (${REGEX(&quot;${pattern}&quot; ${${var}})})<br>
<br>
but that does not work, the backslash is removed, as seen in the log file:<br>
<br>
 &nbsp; func_strings.c: FUNCTION REGEX (^+[0-9]+)(+4312345<br>
&lt;<a href="http://www.adaanumber.com/" target="_blank">http://www.adaanumber.com/</a>&gt;)<br>
<br>
So, meanwhile I tried to escape the backslash. I tried:<br>
 &nbsp; Set(pattern=^\\+[0-9]+);<br>
 &nbsp; Set(pattern=^\\\+[0-9]+);<br>
 &nbsp; Set(pattern=^\\\\+[0-9]+);<br>
<br>
But always the same result:<br>
<br>
 &nbsp; func_strings.c: FUNCTION REGEX (^+[0-9]+)(+4312345)<br>
<br>
How can I solve this problem?<br>
</blockquote><div><br>Try something like... pattern=^[+]\{1\}[0-9]+<br><br>d <br></div></div><br>