none
How to check email ID using regular expression & what it 'll be? RRS feed

  • Question

  •  

     

     

     

     

     

     

    How  to check email ID using regular expression & what it 'll be?

    Monday, October 22, 2007 6:23 AM

All replies


  • i cant get ur question....
    Monday, October 22, 2007 11:55 AM
  • This is what I use. It's not 100% foolproof but works well.

     

    Code Block

    using System.Text.RegularExpressions;

     

    public bool IsValidEmail(string email)

    {

    Regex regex = new Regex(@"^([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([\w\-]+\.)+)([a-zA-Z]{2,4}))$");

    return regex.Match(email).Success;

    }

     

     

    Wednesday, October 24, 2007 3:59 AM

  • fine rahul...
    Wednesday, October 24, 2007 6:36 AM

  • nice one rahul..............
    Friday, October 26, 2007 2:50 AM
  •  

    Hi,

    Please check it is working fine. and it is very good.

    String email_regx

    ="^([a-zA-Z]+(([a-zA-Z0-9]*)|((([^@]{0,}?)[a-zA-Z0-9]+){0,}))([@]{1})[a-zA-Z0-9]+(([.]{1})([a-zA-Z0-9]+)){1,2})$"

     

    Main Validations:

    1.Does Not allow special characters before @.

    2.UserName must Not contain @.

    Wednesday, April 28, 2010 7:23 AM