Try it out on these example inputs:

back to RegexSwap.

24 Hour Time (hh:mm)

Regular expression:

^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$

Categories:

Popularity:

You need to be logged in to cast votes on regexes.

Good
1
Bad
0

Author description and comments (0)

Topic by
kasper

2009-01-06
10:58

Description

Validates a time field with 24 (0-23) hours.

You need to be logged in to participate

In order to post your own comments on this regex, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen