Thread: Regex examples
View Single Post
Old 08-04-2013, 02:13 PM   #274
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by trebor6691 View Post
One of the things I spend the most time editing is bad paragraph breaks. For instance, Tom continued his paragraph

on another line.

The easiest way so far is to regex Search:

</span></p>

<p class="calibre9"><span class="calibre6">[a-z]

then manually <shift> arrow left, and hit space. I would love to Search for the paragraph starting with a lowercase letter, but leave the letter intact and Replace everything before it with the space so that I can replace all at once.

Any help would be greatly appreciated.
You were almost there
Code:
(?sm)</span></p>\s+<p class="calibre9"><span class="calibre6">([a-z])
Code:
(a space here)\1
the slash 1 puts back the captured letter from above
theducks is offline   Reply With Quote