javascript 小时:分钟的正则表达式
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:/***小时:分钟的正则表达式检查**@parampInput要检查的字符串*@returnboolean返回检查结果*/...
复制代码 代码如下:
/**
* 小时:分钟的正则表达式检查<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();
}