Discuss / Java / 作业

作业

Topic source

www.LC.com

#1 Created at ... [Delete] [Delete and Lock User]
Pattern pattern = Pattern.compile("^([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$");// 获得Matcher对象:Matcher matcher = pattern.matcher("23:01:59");if (matcher.matches()) {   String hour = matcher.group(1);    String min = matcher.group(2);    String s = matcher.group(3);   System.out.println(hour);   System.out.println(min);   System.out.println(s);}

  • 1

Reply