public boolean checkPhone(String phoneNum){ Pattern pattern = Pattern.compile("1[1-9][0-9]{9}"); Matcher matcher = pattern.matcher(phoneNum); if (matcher.find()){ return true; } return false; }
时间: 2024-10-11 11:47:23
public boolean checkPhone(String phoneNum){ Pattern pattern = Pattern.compile("1[1-9][0-9]{9}"); Matcher matcher = pattern.matcher(phoneNum); if (matcher.find()){ return true; } return false; }