-(BOOL)judgePassWordLegal:(NSString*)pass{
if(pass.length>8) {
// 数字、字母、符号至少两种
NSString * regex = @"^(?=.*[a-zA-Z0-9].*)(?=.*[a-zA-Z\\W].*)(?=.*[0-9\\W].*).{6,20}$";
NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
return[prede valuateWithObject:pass];
}
return false;
}
网友评论