zjfz-2019-s439462/regexp/Task302.py

12 lines
206 B
Python
Raw Normal View History

2020-01-23 12:38:31 +01:00
import re
def extract_minutes(date):
regex = "^([0-9]|1[0-9]|2[0-3]):([0-5][0-9])$"
out = re.search(regex, date)
if out is None:
return '<NONE>'
else:
return out.group(2)