I missed the study of regular expressions, and in the task you need to do a php check so that a person can enter the time and minutes, a maximum of 99 hours and 59 minutes, the look is 99:59.

I tried it, but it does not work out. /^([01][0-9]|2[0-9]):([0-5][0-9])$/ Tell me, please.

    1 answer 1

     $re = '/([0-9][0-9]):([0-5][0-9])/'; $str = '99:59'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);