Quote:
Originally Posted by G2B
I am experimenting with the search & replace in calibre.

Conversion of txt files often leaves too many line breaks, even with heuristic processing.
When the </p><p class="whatever"> line breaks have small letters on both sides, they can always be removed and substituted with a space.
'[a-z]</p><p class="whatever">[a-z]' finds all those repeats but when I replace with '[a-z] [a-z]' the conversion also removes and replaces every letter before and after the code with the string '[a-z]' which is not what I intended.
I have to include '[a-z] in the search string to find the correct line breaks. If I don't, I'll delete every line break in the book, which imo makes it pretty much unreadable.
Is there a way to include those letters before and after line break in the search string, but to exclude them from substitution?
TIA.
|
Put parens around parts of the search string to form groups. Use \# in the replace string to replace with the content of that group.
Search for:
Code:
([a-z])</p><p class="whatever">([a-z])
Replace with: