Regex for 24-hour time (HH:MM)

Matches 24-hour clock time such as 09:30 or 23:59.

^([01]\d|2[0-3]):[0-5]\d$

Proof it works

6/6 sample tests passed · compiles: true

SampleShould matchResult
00:00 yes pass
09:30 yes pass
23:59 yes pass
24:00 no pass
9:5 no pass
23:60 no pass

Try your own input

Related patterns