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

Function that validates email.


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

0 comments:

Post a Comment