View Single Post
Old 05-17-2009, 12:47 PM   #5
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
Don't forget to add a space! Or you'll be spell checking for days because you stuck two words together at each join.

It's easy to switch all occurrences of multiple spaces to one space, though, if you happen to double up. So first...

Find:
Code:
\r\n([a-z])
Replace:
Code:
\s$1
which will concatenate your lines, then...

Find:
Code:
([a-z])\s+
Replace:
Code:
$1\s
The second regex above should preserve punctuation that has two spaces (or more) following it. It also won't find the extra space that follows should a hyphen, colon, semi-colon, etc., or some other non-lower-case-letter, somehow be at the end of a line that's joined.

Try it on a copy first.

m a r
rogue_ronin is offline   Reply With Quote