/ Published in: ActionScript 3
From the tutorial, Validating Various Input Data in Flash (http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function checkEmailAddress(emailAddress:String):Boolean { var address:String = "([a-z0-9._-]+)"; var domainName:String = "([a-z0-9.-]+)"; var domainExt:String = "([a-z]{2,6})"; var email:RegExp = new RegExp("^" + address + "@" + domainName + "\\." + domainExt + "$", "i"); return email.test(emailAddress); }
URL: http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/