import java.util.regex.Pattern;public class Test { public static void main(String[] args) { // 匹配模式,\\d代表匹配数字,{10}代表正好匹配次数 String regex = "\\d{10}"; System.out.println(Pattern.matches(regex, "9010000000")); }} ...