Java字符串匹配正则表达式

String sftimeString="^[0-9]*:[0-9]*:[0-9]*$";
Pattern pattern=Pattern.compile(sftimeString);
if(pattern.matcher(jtxx.getSc()).matches()){
  //匹配后的逻辑
}

猜你喜欢

转载自www.cnblogs.com/IceBlueBrother/p/9138175.html