i need to find years of dates of births only starting with 18xx and 19xxfrom string
i'm using regex to solve task
i have testing testbirtdays = 'ABCDEFG 01.19.1701 1801 02.18.1901 2001'
def getNumbers(str):
array = re.findall(r'[0-9]+', str)
return array
i can use this function but output will be:
getNumbers(testbirtdays)
#['01', '19', '1701', '1801', '02', '18', '1901', '2001']
my function can't do 2 things:
i need numbers only starting wtih
18and19i need only
4xnumbers to get only years and ignore months/days
so i need output like:
#['1801','1901']