I want a regexp for matching time in HH:MM format. Here\'s what I have, and it works:
^[0-2][0-3]:[0-5][0-9]$
This matches everything from
Your original regular expression has flaws: it wouldn't match 04:00 for example.
04:00
This may work better:
^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$