Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want example like this

ppp@gmail.com
ppp.ddd@gmail.com
ppp23@gmail.com

this type of email only it can accept
Posted

Hey,
U can Use Regular Expression Validator for this.
it will help u
best luck
 
Share this answer
 
Comments
prabakaransat 5-Apr-12 0:58am    
ok.

regards,
praba.
fjdiewornncalwe 11-Apr-12 9:35am    
Please use full words here. We really don't like Textspeak at CP.
Hello,

You can use Regular expression: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b

or you can use the in-build validations of C#.Net, you can find it under:
Toolbox -> Validation -> RegularExpressionValidator


-AJV King
(Vinco Source)
 
Share this answer
 
Try this:
C#
void EmailValidation(object sender, CancelEventArgs e)
       {
           System.Text.RegularExpressions.Regex rEMail = new System.Text.RegularExpressions.Regex(@"^[a-zA-Z][\w\.-]{0,68}[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
           if (txtEmail.Text.Length > 0)
           {
               if (!rEMail.IsMatch(txtEmail.Text))
               {
                   MessageBox.Show("Invalid e-mail id.", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                   txtEmail.SelectAll();
                   e.Cancel = true;
               }
           }
       }
 
Share this answer
 
Hello,


Check this out.


Email ID Validation[^]
 
Share this answer
 
C#
public static bool isEmail(string inputEmail)
{
   inputEmail  = NulltoString(inputEmail);
   string strRegex = @"^([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})(\]?)$";
   Regex re = new Regex(strRegex);
   if (re.IsMatch(inputEmail))
    return (true);
   else
    return (false);
}


You can also see
Email Validation
 
Share this answer
 
Do you have any knowledge about regular expression?
You can follow this page for details in regular expression.
You can validate any thing using regular expression.

http://www.regular-expressions.info/[^]

Go through this site and if have any problem using this and you can ask me freely.

You can use this direct link to example

http://www.regular-expressions.info/tutorial.html[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900