I have some badly formatted text which I am attempting to reformat using the OpenOffice.org Writer's Find/Replace functionality which supports regular expressions as defined here.
The problem is some paragraphs have been split into two paragraphs mid-sentence. For example (using ^ to represent the start and $ to represent end of paragraph):
^This is a good paragraph.$
^He said: "This is a good paragraph."$
^But these$
^are two broken ones that should be merged into one.$
I was hoping to construct a regex to find any paragraphs that don't end in a .
or "
and merge it with the next paragraph (by replacing the end of paragraph with a space, then later I will check for any double spaces).
Doing a find for the search term $
finds (and selects) the end of every paragraph, so it can be replaced. However [^\.]$
finds every paragraph that doesn't end in .
but selects the last character not the end of paragraph so I can't replace it.
Any ideas?