正则
2018-06-15 本文已影响0人
就那ck
//密码相关map对象
var _pswObj = {
"PWD_COMPLEX_LEVEL_ONE":{
text:"6~16位纯数字密码",
reg:/^\d{6,16}$/,
test: function(val) {
return this.reg.test(val)
}
},
"PWD_COMPLEX_LEVEL_TWO":{
text:"6~16位纯字母密码,区分大小写",
reg:/^[a-zA-Z]{6,16}$/,
test: function(val) {
return this.reg.test(val)
}
},
"PWD_COMPLEX_LEVEL_THREE":{
text:"6~16位数字字母组合,区分大小写",
reg:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/,
test: function(val) {
return this.reg.test(val)
}
},
"PWD_COMPLEX_LEVEL_FOUR":{
text:"6~16位数字字母及特殊字符组合",
reg:/^(?!([a-zA-Z\d]*|[\d~`@#\$%\^&\*\-=\+\|\\\?/\(\)<>\[\]\{\}",\.;'!]*|[a-zA-Z~`@#\$%\^&\*\-=\+\|\\\?/\(\)<>\[\]\{\}",\.;'!]*)$)[a-zA-Z\d~`@#\$%\^&\*\-=\+\|\\\?/\(\)<>\[\]\{\}",\.;'!]{6,16}$/,
test: function(val) {
return this.reg.test(val)
}
}
}
```