//匹配中级以上强度密码正则表达式,要求数字、字母、特殊字符~@#$^任意两种组合以上
- (BOOL)passWord:(NSString *)str {
NSString *passWordRegex = @"^((?![0-9]+$)(?![a-zA-Z]+$)(?![~@#$^]+$))[0-9A-Za-z~@#$^]{8,16}$";
NSPredicate *regextestmobile =[NSPredicate predicateWithFormat:@"SELF MATCHES %@", passWordRegex];
if ([regextestmobile evaluateWithObject:str] == YES){
return YES;
}else{
return NO;
};}
网友评论