defining a regex for email adress code example
Example 1: email regex
//Author: Mohammad Arman Khan
//Regular Expresssion for e-mail validation
var email_validator_regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
Example 2: regex for email
^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$
//will validate for: [email protected] etc