Thread: Regex examples
View Single Post
Old 09-27-2012, 07:13 PM   #150
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,746
Karma: 24032915
Join Date: Dec 2010
Device: Kindle PW2
I'm sure that there's a more elegant solution, but you could simply search for a paragraph ending in a lowercase letter or a punctuation sign followed by a paragraph starting with a lowercase letter and then join them with a space.

Code:
Find:([[:lower:]],*;*:*)</span></p>\n\n  <p class="calibre"><span>([[:lower:]])
Code:
Replace:\1 \2
(The regex assumes that Tidy is on and that there are two spaces before each <p>.)

Last edited by Doitsu; 09-27-2012 at 07:26 PM.
Doitsu is offline   Reply With Quote