I am looking for a way to delete (with sed if possible) an html tag containing a specific word. For instance, delete every div tag containing the word foo. The divs can of course contain multiple lines. For instance :
<body>
<div>
This div will be <i>deleted</i>.
Why ?
Because it contains foo.
</div>
<div>
This div doesn't contains the forbidden word.
<b>So it won't be deleted.</b>
</div>
</body>
I found ways to delete html tags, but nothing about tags containing a specific text. Thanks !
sedwill only handle, for example, nesteddivs with great difficulty.