Qns on blank lines

Discussion in 'Python' started by eight02645999@yahoo.com, Mar 3, 2006.

  1. Guest

    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
     
    , Mar 3, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mescaline

    2 very basic qns

    mescaline, Dec 29, 2003, in forum: C++
    Replies:
    5
    Views:
    360
    Ron Natalie
    Dec 29, 2003
  2. Jin

    Misc Qns...

    Jin, Dec 16, 2003, in forum: C Programming
    Replies:
    20
    Views:
    1,057
    Dave Thompson
    Dec 25, 2003
  3. a subprocess qns

    , Apr 21, 2006, in forum: Python
    Replies:
    2
    Views:
    304
    Ben C
    Apr 21, 2006
  4. Replies:
    3
    Views:
    270
    Tim Chase
    Jun 1, 2006
  5. Cah Sableng
    Replies:
    0
    Views:
    240
    Cah Sableng
    Apr 23, 2007
Loading...

Share This Page