RegEX Email Validatoin





8
Date Submitted Mon. Oct. 9th, 2006 8:44 AM
Revision 1 of 1
Beginner shortkid422
Tags "Address" | "Email" | "Expressions" | "php" | "Regular"
Comments 3 comments
This will return a boolean (true/false) if the email address is valid or not.

function validateEmail($email) {
  return eregi("^[a-z0-9]+[a-z0-9_.-]*@[a-z0-9]+[a-z0-9_.-]*\.[a-z]{2,4}$",$email);
}
 

Matt K

Comments

Comments RFC
Thu. Oct. 19th, 2006 9:07 PM    Beginner bugmenot
Comments not RFC compliant
Tue. Oct. 10th, 2006 8:29 AM    Newbie seriouslyuguys

Voting