akoumjian / datefinder

Find dates inside text using Python and get back datetime objects
http://datefinder.readthedocs.org/en/latest/
MIT License
635 stars 167 forks source link

Datetime fails to extract dates when they are right next to each other in a string #149

Open crkucera opened 3 years ago

crkucera commented 3 years ago

For example, this string: "created 01/15/2005 10/12/2021 by ACME Inc. and associates." yields no dates.

vikrambajaj22 commented 1 year ago

I have noticed this happens when a date follows another date or number and they are separated by just one or more delimiters from the supported delimiters (DELIMITERS_PATTERN). For example "date1 date2" where space is the delimiter (like the example above) or "num1. date1" where . and space are delimiters. In either case, no date is extracted successfully.

"date1 ch date2" or "num1. ch date1" work fine if ch is not one of the delimiters.