Innermost containing tag: match/replace it

W

w_laks

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top