RegEx - Time Validation ((h)h:mm)

后端 未结 6 1657
春和景丽
春和景丽 2021-02-13 12:46
/^\\d{1,2}[:][0-5][0-9]$/

is what I have. this limits minutes to 00-59. It does not, however, limit hours to between 0 and 12. For similarity and unifo

6条回答
  •  甜味超标
    2021-02-13 13:18

    This is perfect: ^0?([0-9][0-2]?):[0-5][0-9]$

    Note: 12 Hr Clock Only

    For Times like: 0:01- 12:59

    or

    00:01 - 12:59

提交回复
热议问题