swift 密码由6-16数字和字母组合组成

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Menlo; color: #ffffff; background-color: #282b35 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Menlo; color: #e44347; background-color: #282b35 }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Menlo; color: #93c96a; background-color: #282b35 }
span.s1 { color: #c2349b }
span.s2 { color: #00afca }
span.s3 { color: #ffffff }
span.s4 { color: #e44347 }

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

}

}

上一篇:开发者最常用的 8 款 Sublime Text 3 插件


下一篇:转: sublime text常用插件和快捷键