If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Regular expressions are something that were introduced in AS3 with a sigh of relief from all flash developers. Yay
Below is a code snippet posted by senocular at kriupa
function isValidEmail(email:String):Boolean { var emailExpression:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i; return emailExpression.test(email); } //... trace(isValidEmail("senocular@example.com")); // true trace(isValidEmail("@example.com")); // false trace(isValidEmail("senocular@example")); // false trace(isValidEmail("seno\\cular@example.com")); // false
Its a beautiful thing.
[...] I Have just posted up a code snippet that validates general email addresses in AS2. [Update] - Click here for the AS3 Email Validation Code [...]
[...] as the first. I have added a new email validation process which is new to AS3(regexp) Thanks to flashcs.org for the script. I have also added a drop down menu with the list of countries being pulled from an [...]
[...] I Have just posted up a code snippet that validates general email addresses in AS2. [Update] - Click here for the AS3 Email Validation Code [...]