How to extract date from text using Python regular expression?

PHOTO EMBED

Tue Feb 16 2021 13:11:58 GMT+0000 (UTC)

Saved by @arielvol

import datetime
from datetime import date
import re
s = "Jason's birthday is on 1991-09-21"
match = re.search(r'\d{4}-\d{2}-\d{2}', s)
date = datetime.datetime.strptime(match.group(), '%Y-%m-%d').date()
print date
content_copyCOPY

https://www.tutorialspoint.com/How-to-extract-date-from-text-using-Python-regular-expression