求一邮件验证的正则表达式

解决方案 »

  1.   

    go to http://www.regexlib.com/Search.aspxtype "email" and click on "search" button
      

  2.   

    System.String ex = @"^\w+@\w+\.\w+$";System.Text.RegularExpressions.Regex reg = new Regex( ex );bool flag = reg.IsMatch( str );
      

  3.   

    bool IsValidEmail(string strIn)
    {
    // Return true if strIn is in valid e-mail format.
    return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); 
    }
    其实这样的问题你可以搜索一下论坛,不要动不动就问!