View Single Post
Old 03-02-2018, 11:52 AM   #1
G2B
Enthusiast
G2B began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2018
Device: PC / iPad
Question Regular expressions

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.

Last edited by G2B; 03-02-2018 at 11:55 AM.
G2B is offline   Reply With Quote