Subject: | Pattern for %A rather greedy. |
Consider the following code:
use DateTime::Format::Strptime qw( );
my $strp = DateTime::Format::Strptime->new(
pattern => '%A%m%d_%Y',
on_error => 'croak',
);
my $string = 'Fri0215_2013';
print $strp->parse_datetime($string)->iso8601(), "\n";
The above fails with
Fri02 is not a recognised day in this locale.
The parsing pattern is
/(\w+)([\d ]?\d)([\d ]?\d)_(\d{4})/
\w+ matches too much. Would it be safe for \pL (letter) to be used instead of \w?
Source: http://stackoverflow.com/q/22410253/589924
PS - Would have been nice to have specified %A%02m%02d_%Y to avoid the problem! This would also help in other circumstances.