标签:
真实姓名验证: var truenamereg = /^[\u4E00-\u9FA5]{2,6}$|^[A-Za-z]{2,18}$/;
用户密码验证: var passwdreg = /^[0-9a-z]{6,20}$/i;
用户生日验证: var birthreg = /^\d{4}-\d{1,2}-\d{1,2}$/;
用户手机验证: var phonereg = /^0?(13[0-9]|15[0-9]|18[0-9]|14[57]|17[0-9])[0-9]{8}$/;
用户邮箱验证: var emailreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9_]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
用户联系验证(联系方式,包括手机、 固话) var contactreg = /(^(\d{3,4}-)?\d{7,8})$|((\(\d{3}\))|(\d{3}\-))?1[3-8][0-9]\d{8}?$|15[89]\d{8}$/;
正整数验证: var numreg = /^[0-9]*[1-9][0-9]*$/;
用户身份证验证: var IDCardreg = /(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/;
港澳居民来往内地通行证号码验证正则: var HMCardreg = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/;
护照验证正则: var HZCardreg = /^(P\d{7}|G\d{7,8}|TH\d{7,8}|S\d{7,8}|A\d{7,8}|L\d{7,8}|\d{9}|D\d+|1[4,5]\d{7})$/;
标签:
原文地址:http://www.cnblogs.com/jolab/p/4851826.html