in reply to Re: Date manipulation
in thread Date manipulation
If you've got it, you could use the groovy "named capture" feature of Perl 5.10 to change that regex to:
and then the usage to:$str_date =~ /^\w*\s*\w*\s*(?<month>\w*)\s*(?<day>\d*).*(?<year>\d +{4})$/;
my $date = sprintf("%4d%02d%02d", $+{year}, $months{$+{month}}, $+ +{day});
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Date manipulation
by olus (Curate) on Jul 11, 2008 at 20:58 UTC |
In Section
Seekers of Perl Wisdom