develooper Front page | perl.beginners | Postings from April 2002

regex help

Thread Next
From:
Gabby Dizon
Date:
April 2, 2002 03:49
Subject:
regex help
Message ID:
000701c1da3c$7150d3e0$5e00a8c0@inq7.net
hello list friends,

hope you can help me with my problem. here it is:

i have a date string formatted this way:  $date = "Apr. 02, 2002"
i want to capture the "Apr" (without the period) into $1, "02" into $2, and
"2002" into $3.
note that some months may not be abbreviated (such as May), and therefore
might not have a period.
my regex skills are still sadly inferior (though i'm learning =)

my second (and optional) problem for you to solve: i want to transform this
into mysql date format (yyyy-mm-dd). this is easy enough to do, but i was
wondering if there are any modules there that can date manipulation a lot
easier. if you know any, just let me know.

thanks a lot!

Gabby Dizon
Web Developer
Inq7 Interactive, Inc.
http://www.inq7.net
http://you.inq7.net


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About