电子邮件ID的正则表达式 [英] Regular expression for a email ID
本文介绍了电子邮件ID的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查电子邮件ID是否首先包含数字?然后不接受邮件ID。
ex:1XXX@YYY.com
我尝试过:
^ [a-zA-Z0-9 _.-] * $这是我用过的正则表达式。
How to check if a EMail id consists a number in the first place? Then the mail id should not be accepted.
ex: 1XXX@YYY.com
What I have tried:
^[a-zA-Z0-9_.-]*$ this is the regular expression i have used.
推荐答案
这是我用过的正则表达式。
this is the regular expression i have used.
试试这个:
Try this:
([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})
直接来自快餐 [ ^ ] - 它是免费的,它检查并生成正则表达式。
It's straight from the Expression Library of Expresso[^] - it's free, and it examines and generates Regular expressions.
本文使用常规表达式验证电子邮件地址ssion [ ^ ]可能会帮助你。
This article Email Address Validation Using Regular Expression[^] might help you.
这篇关于电子邮件ID的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文