NSString * regex = @”^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$”; NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; BOOL isMatch = [pred evaluateWithObject:self.txt_cellphone.text]; if (!isMatch) { [txt_cellphone becomeFirstResponder]; return; }
phoneNumber正则表达式
最新推荐文章于 2021-08-23 14:57:06 发布