正则

//密码相关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)
            }
        }
    }
```

你可能感兴趣的:(正则)