yield date
test = """Adelaide was born in Finchley, North London on 12 May 1999. She was a 
child during the Daleks' abduction and invasion of Earth in 2009. 
On 1st July 2058, Bowie Base One became the first Human colony on Mars. It 
was commanded by Captain Adelaide Brooke, and initially seemed to prove that 
it was possible for Humans to live long term on Mars."""
print('With no overlapping:')
for date in find_dates(test, allow_overlapping=False):
    print(date)
print('With overlapping:')
for date in find_dates(test, allow_overlapping=True):
    pass
Python - finding date in a string