I am trying to compose a regExp that accepts HH:mm
time formats, but also accepts all of the intermediate values:
e.g. all of these are accepted:
0
1
12
12:
12:3
12:30
1:
1:3
1:30
For now, I came up with this: ^([\d]{1,2}):?([\d]{1,2})?$
But this accepts any numeric 1/2 digit values for hours and minutes (e.g. 25:66
is acceptable)
So I came relatively close to my goal, but I need to filter out values x>24
from the hours, and x>60
from the minutes?