- 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];
3. BOOL isMatch = [predicate evaluateWithObject:editPhoneField.text];
转载于:https://www.cnblogs.com/zhanglei8831/p/5842544.html