Thread: 0.5.0 Released
View Single Post
Old 01-27-2012, 07:15 PM   #84
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Ahmad - thx for the link. So is it the case now that every time you want to do a multiline regex you have to put (?s) at the front of it? If so, that's... ummm, nasty.

The other find/replace operations I did of things like this:
<p class="xxx">&nbsp;</p>\s+<p class"xxx">&nbsp;</p>
worked without any (?s) so clearly I am missing something. Most of the regex operations I do in Sigil are multiline - in particular repairing broken paragraphs but also stripping repeated blank lines, replacing <br><br> separated text with proper paragraphs etc.

However I also tend to rip out those horrific giant <style> sections with hundreds of lines of utterly pointless font declarations. Or <script> sections containing javascript from html conversions that early Sigil versions couldn't cope with.

I'm not clear on when you need (?s) versus when you don't?
kiwidude is offline   Reply With Quote