PHP - preg_match() and eregi() not working?

scooter77

New Member
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:\[code\]function validateEmail($email) { if(eregi('[a-z||0-9]@[a-z||0-9].[a-z]', $email)){ return true; }}\[/code\]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!
 
Back
Top