Regex is not my friend. He would find a good man to help me.
User can specify working time in the format: 00:00-12:30 or 00:00-12:30,14:15-18:00
I would therefore need to verify the input complies with the variants, but nothing else should pass. I tried to combine pieces like
[0-9] {2} [0-9] {2}
But I really do not understand: /
2 numbers followed space with quantity 2...etc. Every character in a regex has meaning, even if it is just that literal character.[0-9] {2} [0-9] {2}or some parts of that with other code.if($number >= 0 && $number <= 23)or you can use a regex like:/^([01]?[\d|2[0-3])$/. Which would you think is easier to understand?