Posted By

Activetuts on 01/04/11


Tagged

email regexp validation address as3


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

swapnil
chus
nyong15
elderhsouza
tamak


Validate Email Address with RegExp


 / Published in: ActionScript 3
 

URL: http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/

From the tutorial, Validating Various Input Data in Flash (http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/)

  1. public function checkEmailAddress(emailAddress:String):Boolean
  2. {
  3. var address:String = "([a-z0-9._-]+)";
  4. var domainName:String = "([a-z0-9.-]+)";
  5. var domainExt:String = "([a-z]{2,6})";
  6.  
  7. var email:RegExp = new RegExp("^" + address + "@" + domainName + "\\." + domainExt + "$", "i");
  8.  
  9. return email.test(emailAddress);
  10. }

Report this snippet  

You need to login to post a comment.