I am trying to find the time (HH:MM) in string (12 hours ) but the code doesn't work. Hope you can help.
python
import re
pattern = r'^(0?[1-9]|1[0-2]):[0-5][0-9]$'
test_string = 'my activestate platform account is 12:30 now active'
result = re.findall(pattern, test_string)
print(result)