请问这是几点几分?
- 内容介绍
- 文章标签
- 相关推荐
本文共计172个文字,预计阅读时间需要1分钟。
复制代码+代码如下:java/** * 小时:分秒的正则表达式检查 * @param pInput 要检查的字符串 * @return 检查结果 */public static boolean isTime(String pInput) { if (pInput==null) { return false; } // 正则表达式检查 String regex=^[0-9]{1,2}:[0-9]{1,2}$; return pInput.matches(regex);}
复制代码 代码如下:
/**
* 小时:分钟的正则表达式检查<br>
* <br>
* @param pInput 要检查的字符串
* @return boolean 返回检查结果
*/
public static boolean isUrl (String pInput) {
if(pInput == null){
return false;
}
String regEx = " ^([0-1]{1}\d|2[0-3]):([0-5]\d)$";
Pattern p = Pattern.compile(regEx);
Matcher matcher = p.matcher(pInput);
return matcher.matches();
}
本文共计172个文字,预计阅读时间需要1分钟。
复制代码+代码如下:java/** * 小时:分秒的正则表达式检查 * @param pInput 要检查的字符串 * @return 检查结果 */public static boolean isTime(String pInput) { if (pInput==null) { return false; } // 正则表达式检查 String regex=^[0-9]{1,2}:[0-9]{1,2}$; return pInput.matches(regex);}
复制代码 代码如下:
/**
* 小时:分钟的正则表达式检查<br>
* <br>
* @param pInput 要检查的字符串
* @return boolean 返回检查结果
*/
public static boolean isUrl (String pInput) {
if(pInput == null){
return false;
}
String regEx = " ^([0-1]{1}\d|2[0-3]):([0-5]\d)$";
Pattern p = Pattern.compile(regEx);
Matcher matcher = p.matcher(pInput);
return matcher.matches();
}

