Qns on blank lines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eight02645999@yahoo.com

    #1

    Qns on blank lines

    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

Working...