正则表达式

/*手机号*/
function matePhone(isValue){
var patt =  /^1[3|4|5|7|8][0-9]{9}$/;
if(patt.exec(isValue)){
return true;
};
};

/*密码:8-16位,至少含数字/字母/字符2种组合*/

function matePassword(isValue){
var patt = /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^.{8,16}$/;
if(patt.exec(isValue)){
return true;
};
};

posted @ 2017-04-11 09:34  星光泪痕  阅读(111)  评论(0编辑  收藏  举报