time format 24:00 code example Example: time format 24:00 import re regexp = re.compile("(24:00|2[0-3]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9])")