Regular expression for email and 'No Email'
Need regular expression to validate email address also if user don't have email, user able to type 'No Email'. such that regular expression should validate 'No Email' as a valid string.
@"^(([w.-]+)@([w-]+)((.(w){2,3})+)|(No Email))$"
You can combine your regex with an or expression |
var regex = "(.+@.+..+|No Email)"
http://refiddle.com/h2x
The validation part need some improvement (not RFC compliant) but you get the idea.
链接地址: http://www.djcxy.com/p/92642.html下一篇: 电子邮件和“无电子邮件”的正则表达式