悟生慧

 

.NET 正则验证邮箱

///.NET 正则验证邮箱

public bool IsValidEmail(string strIn)
    {
        //   Return   true   if   strIn   is   in   valid   e-mail   format.
        return System.Text.RegularExpressions.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})(\]?)$");
    }

posted on 2011-04-12 09:31  悟生慧  阅读(2919)  评论(0编辑  收藏  举报

导航