I have multi nested quotes in an HTML that look like this:
<div class="quote-container">
<div class="quote-block">
<div class="quote-container">
<div class="quote-block">
</div>
</div>
<div class="quote-container">
<div class="quote-block">
</div>
</div>
<div class="quote-container">
<div class="quote-block">
</div>
</div>
</div>
</div>
I need to search and remove quotes. I use expression:
<div class="quote-container">.*<div class="quote-block">.*</div>.*</div>
This works for single quotes. However there is a problem with multi nested quotes (example above).
My task is to search for:
<div class="quote-container">.*<div class="quote-block">
plus any string NOT containing
<div
and ending with
.*</div>.*</div>
I tried lookbehind and lookahead assertions like this:
<div class="quote-container">.*<div class="quote-block">.*(?!<div).*</div>.*</div>
but they don't work.
Is there a way to do my task? I need a perl expression I can use in TextPipe (I use it for forum parsing and later I do text-to-speech conversion).
Thanks in advance.