String rule = "[a-zA-Z]{3}[0-9]{5}"; Pattern p = Pattern.compile(rule); Matcher m = p.matcher("abc12345"); boolean b = m.matches(); if (b) { System.out.println("YES"); } else { System.out.println("NO"); }
81,091
社区成员
341,719
社区内容
加载中
试试用AI创作助手写篇文章吧