<div class="gmail_quote">2009/2/4 Klaus Darilion <span dir="ltr"><<a href="mailto:klaus.mailinglists@pernau.at">klaus.mailinglists@pernau.at</a>></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>
Set(pattern=^\+[0-9]+);<br>
if (${REGEX("${pattern}" ${${var}})})<br>
<br>
but that does not work, the backslash is removed, as seen in the log file:<br>
<br>
func_strings.c: FUNCTION REGEX (^+[0-9]+)(+4312345<br>
<<a href="http://www.adaanumber.com/" target="_blank">http://www.adaanumber.com/</a>>)<br>
<br>
So, meanwhile I tried to escape the backslash. I tried:<br>
Set(pattern=^\\+[0-9]+);<br>
Set(pattern=^\\\+[0-9]+);<br>
Set(pattern=^\\\\+[0-9]+);<br>
<br>
But always the same result:<br>
<br>
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>