C#中手机号验证,邮箱验证

手机号码

    public bool IsHandset(string str_handset)
    {
            return System.Text.RegularExpressions.Regex.IsMatch(str_handset, @"^[1]+[3,5]+\d{9}$");
    }

 验证 E-mail格式

   public bool IsEmail(string str_Email)
   {
            return System.Text.RegularExpressions.Regex.IsMatch(str_Email,

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

posted @ 2013-04-11 17:06  Entropy_lxl  阅读(395)  评论(1编辑  收藏  举报