正则校验时间,24小时制

var regex =/^([01]?[\d]|2[0-3]):([0-5]?[\d])$/;
var str = '00:00';
console.log(regex.test(str));

猜你喜欢

转载自www.cnblogs.com/erxiaoouba/p/11040567.html