增加电子邮件注册表中点后面的字符数 [英] increase the number of characters after dot in Email RegEx
本文介绍了增加电子邮件注册表中点后面的字符数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下RegEx \w +([ - +。'] \ w +)* @ \ w +([ - 。] \ w +)* \ 。\w +([ - 。] \ w +)*来验证电子邮件。因为我需要限制用户在(点)之后输入至少2个字符(即:raks_laps.cv)part.how我可以更改字符数吗?
问候,
hsakarp。
解决方案
有几种方法可以执行此操作:您可以将最终的\w +更改为\w\w +,或者您可以使用\w {2,}代替。
感谢OriginalGriff,我已将格式更改为^ [_ a-zA-Z0-9 - ] +(\。[_ a-zA-Z0-9 - ] +)* @ [a-zA-Z0-9 - ] + (\ [A-ZA-Z0-9 - ]。[。] +)*(\ [A-ZA-Z] {2,4})
。但我无法测试下面提到的格式有效。请修改regEx。
格式:有效:js#internal @ proseware.com
有效:j_9 @ [ 129 。 126 。 118 。 1 ]
>
问候,
Hsakarp
Hi,
I am using the following RegEx \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* to validate Email. In that i need to restrict the user to enter at-least 2 characters after the (dot) (i.e : raks_laps.cv ) part.how can i change the number of characters to that?
Regards,
hsakarp.
解决方案
There are a couple of ways to do this: you could change the final "\w+" to "\w\w+", or you could use use "\w{2,}" instead.
Thanks OriginalGriff,I have changed the format to ^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+[.])*(\.[a-zA-Z]{2,4})
.But i cant able to test the below mentioned format as valid.COuld you please modify the regEx.
Formats:Valid: js#internal@proseware.com Valid: j_9@[129.126.118.1]
Regards,
Hsakarp
这篇关于增加电子邮件注册表中点后面的字符数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文