Hey there!
I'm having a bit of a problem trying to validate email adresses using preg_match (or eregi() if that suits better). I've tried several regex patterns now and no matter what i do it doesn't seem to work.
Here's the function:
function validateEmail($email) {
if(eregi('[a-z||0-9]@[a-z||0-9].[a-z]', $email)){
return true;
}
}
Any ideas what's wrong? I've tried putting an exclamation point before the eregi (and preg_match that i used before), and that reversed it all (as expected) but still didn't make it work as it should. I want it to return TRUE if it does not pass the regex.
And i didn't use the same regex when on the preg_match function, i found another one then, cause i know you can't really mix those two. Right?
Thanks in advance!