I tried looking around and thought i figured it out by using preg_match, but preg match gives me the error:
Warning: preg_match(): No ending delimiter ‘^’
here is my original code which php says is depreciated:
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST['email'])) {
$erroR= "Invalid Email address";
}
can someone explain what the ending delimiter ‘^’ is, and how to add it. thanks@
Swap
eregi()withpreg_match(), and add delimiters to the regular expression. I chose the standard/here, but you can use other characters.The reason you get this warning…
…is because
preg_match()expects delimiters, and it assumed the^was being used, and it couldn’t match a trailing one.