Home > DeveloperSection > Interviews > what is email validation's regular expression in asp.net

Posted on    June-08-2013 8:23 AM

 ASP.Net ASP.Net 
 2 Answer(s)
  1265  View(s)
Rate this:

Andrew Deniel
Andrew Deniel

Total Post:5

Posted on    June-08-2013 12:00 AM

By using below reg expression we can validate email id


"^[_a-z0-9-]+": start with any underscore or alphanumeric one or more then one alfanumaric word
"(\.[_a-z0-9-]+)*@":any dot(.) or alphanumeric zero times or more the zero and a @ sign
"[a-z0-9-]+":one or more alphanumeric 
"(\.[a-z0-9-]+)*": zero or more dot alphanumeric or -(mins sign)
"(\.[a-z]{2,5})$": End with two to 5 character may use dot (.) in that

Durgesh Tripathi
Durgesh Tripathi

Total Post:3

Posted on    July-20-2013 12:00 AM

The RegularExpressionValidator control is used to ensure that an input value matches a specified pattern.
It's used for email validate,numbervalidate, url validtate, special symbol validate, etc.

Syntax for Regular Expression Validator

<asp:TextBox ID="txtEmailID" runat="server"></asp:TextBox>
 <asp:RegularExpressionValidator ID="revEmailID" runat="server"

Don't want to miss updates? Please click the below button!

Follow MindStick