I want to remove everything between a tag. An example input may be
Input:
<body>
start
<div>
delete from below
<div class="XYZ">
first div having this class
<div>
waste
</div>
<div class="XYZ">
second div having this class
</div>
waste
</div>
delete till above
</div>
<div>
this will also remain
</div>
end
</body>
The output will be:
<body>
start
<div>
delete from below
delete till above
</div>
<div>
this will also remain
</div>
end
</body>
Basically, I have to remove the entire block for the first occurrence of <div class="XYZ">
Thanks,