日期:2014-05-17 浏览次数:20776 次
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"); }