当前位置:主页 > 查看内容

javascript 小时:分钟的正则表达式

发布时间:2021-07-13 00:00| 位朋友查看

简介:复制代码 代码如下: /** * 小时:分钟的正则表达式检查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-……

复制代码 代码如下:

/**
* 小时:分钟的正则表达式检查<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();
}


原文链接:https://m.jb51.net/article/16659.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:js 正则使用方法 下一篇:没有了

推荐图文


随机推荐