ASP.NET: Regular expression validator for e-mail address

A snippet for using the RegularExpressionValidator to validate if form field holds a correct e-mail address:
<asp:RegularExpressionValidator ControlToValidate=
"EmailField" ValidationExpression=
"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Text="*"
ErrorMessage="Not a valid e-mail address" runat="server" />

Related posts:

Comments

comments powered by Disqus