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-12-14 17:04:39
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; }