View Single Post
Old 10-29-2012, 06:40 AM   #4
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
If you get \1 in your text after a replace it means you haven't correctly specified the () parentheses in your Find text. For instance in your very first text you posted, you had the brackets the wrong way around where it should have been ([a-z]) instead of what you typed of [(a-z)]

If you are using Sigil 0.6 then I instead recommend you right-click on the "Find" box, and under "Example Searches" choose "Join Paragraphs".

It isn't quite the same as the case you are looking to catch, but "most" of the time it will achieve the same thing (or improve upon it). The difference is that the expression in this example search is looking for sentences that have unfinished endings, rather than as you are doing of finding sentences that represent unfinished beginnings. There are still some edge cases it will not catch, such as conversation text which has a finished sentence (but not completed quotes) but it is better than most. And unlike your approach it will catch a situation like this:

<p>The reason</p> <p>Bob did this was...

Of course since the original PDF may have OCR errors (like stray commas), or there may be genuine reasons for the text having a new paragraph (like poetry) you should never do a blanket Replace All with such an expression, but it is better than starting from scratch .

Last edited by kiwidude; 10-29-2012 at 06:57 AM. Reason: Miissing slash
kiwidude is offline   Reply With Quote