正则表达式

验证email:string regex = @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$";

验证电话号码:               

       string regex = "^\\(?\\d{3,4}[-\\)]?\\d{7,8}$";
                string regex2 = "^0?\\d{11}$";

验证身份证:string regex=@"^(^\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$";

posted @ 2013-05-21 12:13  haiziguo  阅读(167)  评论(0编辑  收藏  举报