Innermost containing tag: match/replace it

Discussion in 'Perl Misc' started by w_laks@yahoo.com, Jan 20, 2005.

  1. Guest

    I need to extract a couple of image links inside a table containing
    spacer gifs and replace it with a div.
    ==============================================================
    .... some HTML content ...
    <table><tr><td>stuff ...</td></tr></table>
    .... more stuff
    <table> <!-- this needs to be replaced with a <div>
    containing only the yes and no image links -->
    <!-- spacer gif -->
    <a href="#"><img src="yes.gif"/><a/>
    <!-- spacer gif -->
    <a href="#"><img src="no.gif"/></a>
    </table>
    ==============================================================
    If possible I would like to extract the image links and replace its
    *containing* table with the div. I tried the minimal (non-greedy)
    qualifier but I guess it always goes for the left-most match starting
    at the *first* table tag. Can I write a regexp to match and replace the
    innermost containing tag?

    Thanks,
    Lakshmi.
     
    , Jan 20, 2005
    #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. shruds
    Replies:
    1
    Views:
    830
    John C. Bollinger
    Jan 27, 2006
  2. =?Utf-8?B?Sm9obkRlSG9wZTM=?=

    Why Does Asp.Net Use The Innermost Exception?

    =?Utf-8?B?Sm9obkRlSG9wZTM=?=, Jul 14, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    588
    Karl Seguin [MVP]
    Jul 17, 2006
  3. John Gordon
    Replies:
    13
    Views:
    490
    Ian Kelly
    Dec 20, 2011
  4. Replies:
    3
    Views:
    175
    Brian McCauley
    Sep 12, 2005
  5. msciwoj

    RegEx - finding the innermost block

    msciwoj, Jul 16, 2009, in forum: Perl Misc
    Replies:
    2
    Views:
    151
    Martijn Lievaart
    Jul 18, 2009
Loading...

Share This Page