Just figured out this regular expression to remove all tables from a HTML document:
</?table[^>]*>|</?tr[^>]*>|</?td[^>]*>|</?thead[^>]*>|</?tbody[^>]*>
Extreamly useful for cleaning up prehistoric markup with a text editor that supports regular expression find-and-replace searches.
And to go all the way, this one removes font tags too:
</?table[^>]*>|</?tr[^>]*>|</?td[^>]*>|</?thead[^>]*>|</?tbody[^>]*>|</?font[^>]*>
YOU ROCK!!
Thanks a lot, you have no idea how much time you’ve saved me!
Pretty good, but missing a few things:
]*>|]*>|]*>|]*>|]*>|]*>|]*>|]*>
would be more complete.
Thanks for the foundation
ugh, it stripped everything else out.
I added th and tfoot
Great code