RegEx email
/^((?!\.)[\w-_.]*)(@\w+)(\.\w+(\.\w+)?)$/gim;
Just playing with Reg Ex. This to validate emails in following ways
The email couldn't start or finish with a dot
The email shouldn't contain spaces into the string
The email shouldn't contain special chars ( mailname@domain.com
First group takes the first string with the name of email \$1 => (mailname)
Second group takes the @ plus the domain: \$2 => (@domain)
Third group takes the last part after the domain : \$3 => (.com)