开发者

Not accepting capital letters but it should

开发者 https://www.devze.com 2023-02-27 01:13 出处:网络
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.

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消