ASP.NET email validator regex

有谁知道ASP.NET中的电子邮件验证程序使用的正则表达式是什么?


Here is the regex for the Internet Email Address using the RegularExpressionValidator in .NET

w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*

By the way if you put a RegularExpressionValidator on the page and go to the design view there is a ValidationExpression field that you can use to choose from a list of expressions provided by .NET. Once you choose the expression you want there is a Validation expression: textbox that holds the regex used for the validator


I don't validate email address format anymore (Ok I check to make sure there is an at sign and a period after that). The reason for this is what says the correctly formatted address is even their email? You should be sending them an email and asking them to click a link or verify a code. This is the only real way to validate an email address is valid and that a person is actually able to recieve email.


E-mail addresses are very difficult to verify correctly with a mere regex. Here is a pretty scary regex that supposedly implements RFC822, chapter 6, the specification of valid e-mail addresses.

Not really an answer, but maybe related to what you're trying to accomplish.

链接地址: http://www.djcxy.com/p/92862.html

上一篇: Ruby与正则表达式的电子邮件验证

下一篇: ASP.NET电子邮件验证器正则表达式