Regular expression for matching time in military (24 hour) format

后端 未结 11 750
庸人自扰
庸人自扰 2020-12-23 13:44

I would like a JavaScript regular expression that will match time using the 24 hour clock, where the time is given with or without the colon.

For example, I would li

11条回答
  •  独厮守ぢ
    2020-12-23 14:28

    Here's a blog post, looking for the same thing and a bunch of potential answers -- most of which don't work, but there is good discussion as to why each fails.

    Of course, explicitly long and accurate is always a possibility!

提交回复
热议问题