I have the email content. From this content I then want to extract any times that exist. The times are in 24 hour format, contain a colon separator (eg 13:00) and can appear anywhere in the text.
As an example:
"Some text some text some text 12:00 Some text some text some text"
When I use this line to extract the time, the result is blank:
tp_time = re.findall(r'(^[0-2][0-3]:[0-5][0-9]$)', tp_msg)
print(tp_time)
Can anyone see what I am doing wrong?
[0-2][0-3]:[0-5][0-9]will not match e.g.17:00. What's going on?(2[0-3]|[0-1][0-9]):[0-5][0-9]instead.