我如何在0:00:00到11:59:00 Pm验证时间 [英] How Do I Validate Time In 0:00:00 Am To 11:59:00 Pm
本文介绍了我如何在0:00:00到11:59:00 Pm验证时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何在凌晨0:00:00到晚上11:59:00验证时间?
解决方案
有很多方法,但是一个正则表达式可能是最简单的:
^(1 [012] | [1-9]):[0-5] [0-9](\ s) ?(我?)(AM | PM)块引用>
块引用>
how do i validate time in 0:00:00 AM to 11:59:00 PM ?
解决方案There are a lot of ways, but a Regex is probably the simplest:
^(1[012]|[1-9]):[0-5][0-9](\s)?(?i)(am|pm)
这篇关于我如何在0:00:00到11:59:00 Pm验证时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文