472,096 Members | 1,591 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

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 4811
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.