C# 判断邮件格式

        public static bool IsValidEmail(string Mail)
        {
            string strRegex = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
            System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(strRegex);
            if (re.IsMatch(Mail))
                return true;
            else
                return false;
        }

 

posted @ 2021-01-10 13:27  筱米米  阅读(310)  评论(0)    收藏  举报