Reputation: 82
I need a regex to exclude certain characters such as 'ç' and also to check '@' sign is present. Can someone help?
I am using jquery to do client-side validation using the following expression:
(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[\w-]{2,4}$/)
Upvotes: 0
Views: 4012
Reputation: 5659
Chiefly:
function isAValidEmailAddress(emailAddress){
return /^[a-z0-9_\-\.]{2,}@[a-z0-9_\-\.]{2,}\.[a-z]{2,}$/i.test(emailAddress);
}
Use http://en.wikipedia.org/wiki/Email_address#Syntax for a better regular expression.
Upvotes: 5