ios 数字 字母 特殊符号(6-20)位
-(BOOL)judgePassWordLegal:(NSString *)text{ BOOL result = false; if ([text length] >= 6){ // NSString * regex = @"^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[~!@#$%¥^&*()_+`\\-={}:\";'<>,.|€£/]).{6,20}"; NSString * regex = @"^.{6,20}"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; result = [pred evaluateWithObject:text]; } return result; }