I am scraping Amazon reviews. The date is shown as:
Reviewed in the United States on September 1, 2018
What is the regex to extract September 1, 2018?
Thanks
I am scraping Amazon reviews. The date is shown as:
Reviewed in the United States on September 1, 2018
What is the regex to extract September 1, 2018?
Thanks
Assuming the date format is always the same, and it's always preceded by "on ", this would work:
(?<=on )[A-S].+[12]\d{3}$
Thanks. I managed to find another regex which will work even if the language is not English (meaning there is no "on"):
[a-zA-Z]+(?:[^a-zA-Z]+[a-zA-Z]+){0}[^a-zA-Z]*$
The above will extract the last 3 words from a sentence. Hence output is:
September 1, 2018