I have the following code in Python:
txt = 'Ted\'s date of birth is 5-6-2005 and he started college at 08-5-2019'
year = re.compile(r'[1900-2023]+')
res = year.findall(txt)
for i in res:
print(i)
the code above returns:
200
0
2019
since [1900-2023]
returns any match between range of 1900
to 2023
, why here it returned 200 and 0 which is out of this range? Moreover it even didn't return 2005 which is within this range.