function isValidEmail(email:String):Boolean {
var emailExp:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
return emailExp.test(email);
}
trace(isValidEmail("admin@domain.com")); //Outputs true
trace(isValidEmail("admin.@.com")); //Outputs false
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Email Validation
Posted by
admin
on Friday, July 17, 2009
Labels:
Strings
Function that validates email.
0 comments:
Post a Comment