View Single Post
Old 01-29-2013, 12:23 PM   #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: 2,774
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Kindle Fire HDX 8.9 , Kindle for PC
replace all has to be triggered twice

i am seeing some unexplained behaviour with replaceall regex in that it sometimes has to be run twice to truly replace all.
I isolate a phrase & set up the find regex with a blank replace.

then I click replace all & it does one or two replacements, but when I click it again, it does a whole lot more.

I can't puzzle out why it needs to run twice.

e.g. most my recent example - removing unwanted anchors from chapter starts..
I use find
<a class="calibre7" id="filepos\d+"></a>
+ replace all
(with nothing)

. expecting 29 hits , 1 per chapter, instead I got only 2 hits, followed by 27 hits at next attempt.

the open xhtml was 1st chapter.
mode regex, all hteml files - down + replace all. nothing else ticked.

any explanation as to why it needed to be run twice?
cybmole is offline   Reply With Quote