Quick Nav:  Online Store   |   Login | Register

Regex assitance please... removing tags and contents in between..

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Nelson Fernandez
<100 Posts
Posts:50


10/26/2007 4:57 PM  

I need to be able to remove an html tag and it's contents. For example and embed tag or a script tag. How could I do this?

John Mitchell
Posts:3196


10/26/2007 5:05 PM  
To remove a block of code you first need to identify the opening of the block uniquely and then find the closing of the block.
The .*? combination of regex characters are the easiest way to do a wildcard.

So if you wanted to remove a div tag with an id="MyDiv" and everything in it you would use a regex like this:


SearchFor:  <div.*?id="MyDiv".*?</div>
ReplaceWith: 

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Regex assitance please... removing tags and contents in between..



ActiveForums 3.7
Powered by: Snapsis Software