问题描述
使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。
[email protected],
[email protected] ,
[email protected],
[email protected]
[email protected]或uk或nz
[email protected],
它将失败休息所有它不应该以数字开头,而不是特殊符号除了_(下划线)。而域名也不能在domain_name或域名或域名中!@#$ name。休息一切都需要接受。
我曾尝试过这个(\\\ +--+.]?)+@\ w +([ - 。] \ w +)* \.\ w +([ - 。] \ w +)*表达式。但在这里我可以访问初始值中的数字,特殊字符。
Regular Expression for Email Format Validation using ASP.NET 4.0.
[email protected],
[email protected],
[email protected],
[email protected]
[email protected] or uk or nz
[email protected],
It will fail for rest all like it should not start with numbers,not special symbols except _(underscore). And also the domainname can't be in domain_name or domain-name or domain!@#$name. Rest all need to accepted.
I had tried by this (\w+[-+.]?)+@\w+([-.]\w+)*\.\w+([-.]\w+)* expression. But here I can access numbers, special characters in initial value.
推荐答案
string pattern = @"[a-z0-9!#
这篇关于使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!