perl regex to python

nlymbo at my-deja.com nlymbo at my-deja.com
Wed Feb 7 01:02:30 EST 2001


Hi all, in perl i would do this to pick apart a date string:

if ($date_str =~ m#(\d+)/(\d+)/(\d+)#) {
  print "month: $1, $day: $2, $year: $3\n";
}

How does one save the matches in a reg expression using Python??
Thanks.

sf-l8


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list