I have several Word documents where line breaks (paragraph breaks) have been added purely for cosmetic reasons (probably by a human, but maybe by an OCR system or something similar). I want to remove these extra line breaks from the documents. Basically, an 'extra' line break is one that is surrounded by lower-case letters on either side (with optional whitespace). Unfortunately, though, if I want to find paragraph breaks in Word (^p) I can't use character classes to find only lower-case letters ([a-z]) and vice versa.
Basically I want to use a multiline regex on the document so I can find something like the following:
/[a-z]\s*\n\s*[a-z]/
and replace the newline with a space. Is there any way I can search for both paragraph marks (^p in Word) and character classes (or just lower-case letters in general)?
EXAMPLE:
TITLE¶
This is some text.
would not match, but
this text is on one line and¶
goes on to the next line.
would match and the “¶” would be replaced by a space.