469,904 Members | 2,087 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

RegEx to remove HTML tag by ID (including any nested tags)

Hi

I'm trying to use RegEx to remove a tag by it's ID attribute. The actual HTML has already been cleaned up as I am formatting for export to Excel (so no need to point out that it's incorrect HTML!) - therefore, the example of what I am wanting to remove is as follows:


STUFF I WANT TO KEEP GOES HERE

<TABLE id=multiupdate width=*>
<TABLE>
<TR>
<TD style='border-style:solid;border-width:1px;'class=Title width=60>Invoice No. </TD>
<TD></TD></TR></TABLE></TABLE>

STUFF I WANT TO KEEP CONTINUES HERE

I can make a RegEx patern that will match all table tags but I only want to match the ones with the id=multiupdate string in them.

Any guidance would be much appreciated!
Sep 12 '07 #1
2 4706
jhardman
3,406 Expert 2GB
What is the regEx you are using to match all tables? Maybe this will answer your question.

Jared
Sep 13 '07 #2
jhardman
3,406 Expert 2GB
On second thought, are you saying that your regex will break if there is a nested table? that would make sense. You might have to use something more complicated than a regEx.

Jared
Sep 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Dean H. Saxe | last post: by
8 posts views Thread by G. Stewart | last post: by
1 post views Thread by Maya | last post: by
13 posts views Thread by Chris Lieb | last post: by
7 posts views Thread by MrNobody | last post: by
2 posts views Thread by Shawn B. | last post: by
3 posts views Thread by Rob | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.