Add special characters to Asp.net RegularExpressionValidator for E-Mail
Posted
by Hasan Gürsoy
on Stack Overflow
See other posts from Stack Overflow
or by Hasan Gürsoy
Published on 2010-03-29T13:07:18Z
Indexed on
2010/03/29
13:13 UTC
Read the original article
Hit count: 267
I have a e-mail address validator but I need to add special characters as valid for example ü, ç... Because users in Turkey (or anywhere else) can have a web site url like: hasangürsoy.com My code is below:
<asp:TextBox ID="tEMail" runat="server" />
<asp:RequiredFieldValidator ID="rfvEMail" runat="server"
ControlToValidate="tEMail" ErrorMessage="* required" />
<asp:RegularExpressionValidator ID="revEMail" runat="server"
ControlToValidate="tEMail" ErrorMessage="* invalid"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
© Stack Overflow or respective owner