You can use following function for validation of email using ActionScript 3.0 RegExp class.
/**
* @usage Check if the given email address string is valid or not
* @param email:String Email address string that is to be checked
* @return Boolean Returns true if valid email, false otherwise
*/
public function isValidEmail(email:String):Boolean
{
var emailExpression:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
return emailExpression.test(email);
}
Hope it would be useful to someone
Regards,
Naresh Khokhaneshiya
Posted by drunkcat on December 17, 2008 at 10:14 pm
was useful for me. Thanks!!
Posted by Physx on December 30, 2008 at 10:44 am
Thanks
Posted by Kaiowas on April 29, 2009 at 11:15 pm
It’s only working for a handful of email addresses
when there’s a numeric char in the mail it’s not working
Posted by Naresh Khokhaneshiya on May 20, 2009 at 8:01 am
It does not work when there are only digits or if the first letter is a digit.
Posted by Ashok on May 9, 2009 at 11:41 am
Thanks dude its very useful for me.
Posted by Roy on July 3, 2009 at 10:44 am
Try this one
/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i