I would like a JavaScript regular expression that will match time using the 24 hour clock, where the time is given with or without the colon.
For example, I would li
I know this is an old question but here's a regex I came up with which seems to work.
^(([[0|1]\d)|(2[0-3]))[:]?([0-5]\d)$
You can edit it on this regex site
Edit I just realised that this answer ended up exactly the same as the accepted answer but I will leave it here at least for the value of the 'do it yourself' link