I have regex for time /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/
This validates 24-hr format as well.
What should be the regex if I do not want to accept leading zeroes?
Example:
9:31 not 09:31
Update:
This issue: Regular expression for matching HH:MM time format accepts both with leading and without leading zeroes. But I'm looking for a 24-hr regex that DOES NOT ACCEPT LEADING ZEROES. It's not a duplicate
I tried this:
^([1-9]|1[0-9]|2[0-3]):[0-5][0-9]$
but doesn't accept 0:24
Any ideas? Thank you