in reply to Regex to parse a date

Of course, TIMTOWTD, but:

#!/usr/bin/perl $a = '2003 % 05 % 1720:55:23'; $a=~ s/[0-9]{2}\:[0-9]{2}\:[0-9]{2}$//; $a=~ s/\s+\%\s+/-/g; print $a,"\n";

Output:

2003-05-17

Leonid Mamtchenkov aka TVSET

Replies are listed 'Best First'.
Re: Re: Regex to parse a date
by MD (Initiate) on May 19, 2003 at 10:15 UTC
    Many thanks Leonid! TIMTOWTD indeed! :-))