Regular help about time

the format of HH:MM;" needs to be verified, such as: HH is hour, from 00-23th MM to minute, from 00-59; it can be repeated more than one time, ending with a semicolon; for example:

00:00;
23:59;
18:23;12:07;
01:12;12:22;20:00;

help regular master, thank you very much!


fixed HH:MM; time format check should be easy to write

00:00-19:59 split into a segment, [0-1] [0-9]: [0-5] [0-9] ;
20:00-23:59 split into a segment, 2 [0-3]: [0-5] [0-9] ;

then one or more, +

/^(([0-1]\d|2[0-3]):[0-5]\d;)+$/.test('00:00;23:50;')
The definition of the regular words

is not obvious, and it is difficult to write because they are all numbers plus colons. It is suggested to change a way of thinking, write your own template and then replace it, and finally see whether it conforms to the template. The parse in the specific implementation method https://codeshelper.com/a/11.
is such a way of thinking to see if it can solve your problem

.
Menu