Expression for Email Address validation in C#


<asp:TextBox ID=”txtEmail” runat=”server”></asp:TextBox> —————————————————————————- <asp:RegularExpressionValidator ValidationExpression=”^([a-zA-Z0-9_\-\+\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$” ID=”rxpEmail” runat=”server” ErrorMessage=”Email Address is not valid” ControlToValidate=”txtEmail”> —————————————————————————- For Online Testing http://www.regextester.com/ http://rubular.com/

1 2 3