Im trying to use regex(python) to match the time in a string while accounting for user discrepancies such as am pm or capitols, a single number to start(9:30) and use of a .
or :
. I am very close with the following:
(\d{1,2}(:|.)\d{2}\s?(?:AM|PM|am|pm))
but when using https://pythex.org/ to check it returns two matches for most strings, example string:
@Stand-up Bot at 4.30am every day
The issue is that I'm getting two matches, one for the time 4.30am
which is great but I'm also getting a second match for the separating character in between the numbers .
or :
.
How can I update the regex to return just the exact time match and not the separating character too?
Thanks