使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。 [英] Regular Expression for Email Format Validation using ASP.NET 4.0.

查看:90
本文介绍了使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。



test@domainname.com,

test_123@domainname.com ,

test.124@domainname.com,

test12.34_56test@domainname.com

test12.34_56test@domainname.co.in或uk或nz

test@196.27.2.1,



它将失败休息所有它不应该以数字开头,而不是特殊符号除了_(下划线)。而域名也不能在domain_name或域名或域名中!@#$ name。休息一切都需要接受。





我曾尝试过这个(\\\ +--+.]?)+@\ w +([ - 。] \ w +)* \.\ w +([ - 。] \ w +)*表达式。但在这里我可以访问初始值中的数字,特殊字符。

Regular Expression for Email Format Validation using ASP.NET 4.0.

test@domainname.com,
test_123@domainname.com,
test.124@domainname.com,
test12.34_56test@domainname.com
test12.34_56test@domainname.co.in or uk or nz
test@196.27.2.1,

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.

推荐答案

name。休息一切都需要接受。





我曾尝试过这个(\\\ +--+.]?)+@\ w +([ - 。] \ w +)* \.\ w +([ - 。] \ w +)*表达式。但在这里我可以访问初始值中的数字,特殊字符。
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.


尝试谷歌 [<一个HREF =https://www.google.co.in/search?q=Regular+Expression+for+Email+Format+Validation&oq=Regular+Expression+for+Email+Format+Validation&sugexp=chrome,mod = 7& sourceid = chrome& ie = UTF-8target =_ blanktitle =新窗口> ^ ]首先是Mannava,它会在短时间内为您提供巨大的搜索结果。大多数线程都可以很容易地解决您的问题。看看。
Try on google[^] first Mannava, it will give you huge search results in quick time. And most of the threads will solve your problem quite easily. Take a look.


你没有提到你的电子邮件模式匹配代码..

因此我给你以下模式试试看..我告诉我它帮助你与否。

U didnt mention your code for email pattern match..
Hence i m giving u following pattern try it out..n let me know its helping u or not.
string pattern = @"[a-z0-9!#


这篇关于使用ASP.NET 4.0进行电子邮件格式验证的正则表达式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆