help in converting perl re to python re

eight02645999 at yahoo.com eight02645999 at yahoo.com
Fri Mar 3 02:07:30 EST 2006


hi

i have some regular exp code in perl that i want to convert to python.


if $line =~ m#<(tag1)>(.*)</\1>#
   {
     $variable = $2;
    }

the perl code finds a line that matches something like

"<tag1>sometext<\tag1>" in the line and then assign $variable the value
of  "sometext"

how can i do an equivalent of that using re module?
thanks




More information about the Python-list mailing list