View Single Post
Old 12-16-2012, 08:51 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Question help removing nested blockquotes please

I have not mastered how to do multi-line regex yet with the current engine.

I want to strip all but one layer of all blockquote nestings e.g,
go from 2 or more level deep like this
<blockquote class="a">
<blockquote class="a">
<blockquote class="a">
<p class="text">some text here</p>
</blockquote>
</blockquote>
</blockquote>

and reduce it to
<blockquote class="a">
<p class="text">some text here</p>
</blockquote>

i figure that the regex only needs to shrink 2 layers to 1, then if it is run multiple times it will progressively strip layers until only single layers remain.
assume also that I can by inspection insert the appropriate class names into the regex

I tried find
<blockquote class="calibre11">\s*<blockquote class="calibre11">(.*)</blockquote>\s*</blockquote>
with a suitable replace all, but it did not fully automate.( it seemed to only do one instance, evenwhen I said replace all) ; also I was not sure if I needed to tick any options e.g. Dotall
cybmole is offline   Reply With Quote