I have a a REGEX for v开发者_如何学JAVAerifications of user email addresses. The issue is, it's not accepting them in capitals even though it should.
Example:
OK => example@gmail.com
NOT OK => EXAMPLE@GMAIL.COM
Here is the REGEX
/^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/
I want it to accept both, how do I do make it work?
Thanks.
UPDATE
You can see sample here if you want... http://www.teeshirtyeswekahn.com/
(Just add a a shirt to basket and click next, you'll see the form there).
try this one ^([a-zA-Z0-9_\-\.]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-zA-Z]{2,3})$
Yes, it does match.
Try this Regex : A simple Javascript Email-Id validation.
function valid_email(email) {
var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
if (!email.match(re))
return false;
else
return true;
}
精彩评论