/^\\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
Assuming you are working in 12 hour time, 0 is not a valid hour and should also be excluded (as pointed out by Jon). Here is a basic solution:
/^(0?[1-9]|1[012]):[0-5][0-9]$/
A 24-hour time regex matcher that works similarly:
/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/