PagodNaUtak
asked on
Regular expression email validation
Hi,
I have the below javascript code that validates email address, unfortunately this regular expression does not accept the email address o'neil@yahoo.com. How do I revise the code below so that it will accept email address with apostrophe?
Your input is greatly appreciated.
I have the below javascript code that validates email address, unfortunately this regular expression does not accept the email address o'neil@yahoo.com. How do I revise the code below so that it will accept email address with apostrophe?
Your input is greatly appreciated.
var objRegEx = /(^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;
ASKER
I receive syntax error in regular expression.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var objRegEx = /(^[a-zA-Z0-9._-']+@[a-zA-