View Single Post
Old 01-07-2011, 04:13 PM   #11
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,732
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by cybmole View Post
thinking it through - the annoying section structure is ABABA where A is the expression, B is the line feed stuff.
so if I find (AB){2} and replace with nothing, I should end up with one instance only of expression A.

I already fixed up the text using your long hand version though so I cannot easily test that now.
To be honest I just was lazy and gave the expression that I use - less regex syntax to remember as you do it . Just copy the three lines, paste in to the find dialog and replace the two gaps with \s+ and you are done.

However yes I believe you could also do something like
(<p class="MsoPlainText">&nbsp;</p>\s+){3}

In this case you don't have to worry about ABABAB because Sigil reformats the document anyway so it does not matter if the last B (the spaces rendered as a newline in code view) get replaced.
kiwidude is offline   Reply With Quote