time regex

preg_match("/(1[012]|0[0-9]):([0-5][0-9])/", $foo)

for 12-hour or

preg_match("/(2[0-3]|[01][0-9]):([0-5][0-9])/", $foo)

for 24-hour.

If you use a 24-hour clock going from 01:00 to 24:59, use

preg_match("/(2[0-4]|[01][1-9]|10):([0-5][0-9])/", $foo)