Java示例匹配电话号码2 Java示例匹配电话号码1 Java示例计数单词组1 Java示例匹配电话号码2 public class Main { private static boolean isValid(String s) { String regex = "\\d{2}-\\d{4}-\\d{6}"; return s.matches(regex); } public static void main(String[] args) { System.out.println(isValid("91-9652-018244")); } } Java示例匹配电话号码1 Java示例计数单词组1