请问JAVA中如何做时间正则 如题,我只想要时间正则,不要日期正则的。比如我只想判断类似的23:05:00 的时间 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static void main(String[] args) { //23:05:00 String strRegex="(([0-1][0-9])|([2][0-4])):([ ]?[0-5][0-9]):([ ]?[0-5][0-9])"; String strTime="23: 05: 00";//中间的空格可有可无 String strNoTime="24: 50: 60"; System.out.println(strTime.matches(strRegex)); System.out.println(strNoTime.matches(strRegex)); } java语义问题 not an enclosing class error. 如果获得鼠标的X和Y 从文本文件取值并存放到数组或者其他Collections中的问题 基本问题!( 没几个人能回答 ) 面试题提问了,基础 String和StringBuffer的区别? 建立一个JavaBean能不能在另一个类中建立它的类方法???? 返回结果集的问题 socket发送数据一问: j2ee学习之路? 关于this的用法。。一个小问题啊。。
//23:05:00
String strRegex="(([0-1][0-9])|([2][0-4])):([ ]?[0-5][0-9]):([ ]?[0-5][0-9])";
String strTime="23: 05: 00";//中间的空格可有可无
String strNoTime="24: 50: 60";
System.out.println(strTime.matches(strRegex));
System.out.println(strNoTime.matches(strRegex));
}