in reply to Regex to parse a date

My own is this:

my $dt   = "2003 % 05 % 1720:55:23";
$dt =~ /^(\d{4}) % (\d{2}) % (\d{2})/;
$date = "$1-$2-$3";
print "$date\n";
You'll need to change this one if the day of month can have one digit instead of two (i.e. 7 instead of 07). Michele.

Replies are listed 'Best First'.
Re: Re: Regex to parse a date
by Anonymous Monk on May 19, 2003 at 12:37 UTC
    Thanks Michele :-)

    MD