- NSString *regex =[NSString stringWithFormat:@"^1(3[4-9]|5[012789]|8[2378]|47)\\d{8}$"];
- NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
3. BOOL isMatch = [predicate evaluateWithObject:editPhoneField.text];
时间: 2024-11-02 23:29:50