Trying to extract the date out of this string:
Publisher: Broadway Books; Anniversary, Reprint edition (October 8, 2002)
I want to get this: October 8, 2002
This is the regex I was using. Goal is to make it work for any date in the format above. It works when I test it on https://regex101.com/ but returns "None" in my code.
pattern = re.compile("(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?)\s+\d{1,2},\s+\d{4}")
date = pattern.match(tag.get_text())