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 don't think regex is the right solution for this problem. Sure, it COULD be done, but it just seems wrong.
Make sure your string is four characters long, or 5 characters with a colon in the middle. Then, parse each side and make sure that the left side is less than 24 and the right hand is less than 60.
The regex solution is just so much more complicated.