Subject: Regular Expression to remove <table> </table> tags
Posted By: mathalete Post Date: 1/22/2006 11:17:12 AM
Hi all,

does anyone know of a regular expression to remove tags:
<table> </table>
<tr> </tr>
<td> </td>
from a HTML document.

The purpose of which is to migrate a website from a table layout to a CSS <div> based one.

Cheers

Peter.


Reply By: richard.york Reply Date: 1/23/2006 10:59:47 AM
While your goal may have something to do with CSS, this is not a CSS question.  Please ask this question in the appropriate language forum (ASP, C#, Java, Perl, PHP, etc).

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply By: ciderpunx Reply Date: 1/23/2006 12:59:11 PM
<OT>
I know its OT, and apologise, but it's only 1 line of perl:
while(<>){s/(<[\/]?table>|<[\/]?t[dr]{1}>)*//gi;print;}
</OT>


--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com

Go to topic 39072

Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380
Return to index page 379
Return to index page 378