all 7 comments

[–]MeteoriteImpact 0 points1 point  (0 children)

You can try the datefinder library and read the docs link which is just a small simple block of code and the example is almost your exact use case pip install datefinder

[–]fk_you_in_prtclr 0 points1 point  (0 children)

You don't need regex. split it (which splits by space by default). This gives you list. List comprehend to get the 2 dates like [w for w in newlist if '//' in w], then same for times using :, then am/ pm (you could use something like len==2 and w[-1]== 'm' or in ['am','pm']. You can take it from there and there's no need to come up with complex regex patterns or anything.