Converting DD MM YYYY into YYYY-MM-DD?

Gilles Ganault nospam at nospam.com
Tue Aug 18 02:59:57 EDT 2009


Thanks everyone for the help. This script is just a one-shot thingie
on my work host, not as a web script or anything professional.

On Mon, 17 Aug 2009 17:05:28 -0700 (PDT), Jonathan Gardner
<jgardner at jonathangardner.net> wrote:
>Unfortunately, there isn't any string to date parsers in the built-
>ins. Not to worry, though, since writing your own is easy, especially
>if you use regular expressions from the re module. I suggest using an
>RE such as:
>
>    r"(?P<date>\d+)\s+(?P<month>\w+)\s+(?P<year>\d+)"

I've never seen regexes like this. I'm curious to know what those
mean:

r = Unicode?

(?P<date> = ? means that it shouldn't be greedy, what about P<date>?



More information about the Python-list mailing list