Symbol YCAAO.BA has some dates in the format YPF SA FR BDS 21/10/2023 ARS1 that was matching the /\d{2}\/\d{2}\/\d{4}/ regex for date parsing, but fails because strptime errors against the defined template.
This PR adds start-of-line and end-of-line tokens to the string matching so that strptime only parses dates that match the defined formats and no more. For example, it will continue to match 02-25-1991, but will not match ABC 02-25-1991 or 02-25-1991 XYZ. If a date can't be parsed by strptime, parsing falls back on just returning the original string as per existing functionality.
Symbol
YCAAO.BA
has some dates in the formatYPF SA FR BDS 21/10/2023 ARS1
that was matching the/\d{2}\/\d{2}\/\d{4}/
regex for date parsing, but fails becausestrptime
errors against the defined template.This PR adds start-of-line and end-of-line tokens to the string matching so that
strptime
only parses dates that match the defined formats and no more. For example, it will continue to match02-25-1991
, but will not matchABC 02-25-1991
or02-25-1991 XYZ
. If a date can't be parsed bystrptime
, parsing falls back on just returning the original string as per existing functionality.Fixes #29. :+1: