swift 密码由6-16数字和字母组合组成
class func isPassword(pasword : String) -> Bool {
let pwd = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$"
let regextestpwd = NSPredicate(format: "SELF MATCHES %@",pwd)
if (regextestpwd.evaluate(with: pasword) == true) {
return true
}else{
return false
}
}