iOS 检测是否为合法密码

//联系人:石虎QQ: 1224614774昵称:嗡嘛呢叭咪哄

一、概念

#pragma mark -检测是否为合法密码

- (BOOL)isLegalPassword:(NSString *)psw {

NSString *passWordRegex =@"^[\\w~\\!\\@\\#\\$\\%\\^\\&\\*\\?\\(\\)\\+\\-=\\[\\]\\{\\|`\\};:'\"\\,\\.\\/]{6,32}$";

NSPredicate *passWordPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",passWordRegex];

return[passWordPredicate evaluateWithObject:psw];

}

谢谢!!!

你可能感兴趣的:(iOS 检测是否为合法密码)