Thread: Regex problem
View Single Post
Old 01-19-2014, 11:37 AM   #4
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: 31,115
Karma: 60406498
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 John2011 View Post
I hope someone can help me with a Regex problem.

I have a book without any spaces between some sentences.
Sentence one.Sentence two.

I would like it to be;
Sentence one. Sentence two.

I have been using
find:
([a-z]\.[A-Z])

which seems to find the Sentences without the space OK. I did a count and 256 were found.

But for the life of me I can't seem to get a Replace code.
I am using Sigil to do the work.

Does any of you learned folks have a suggestion?

Thanking you,
John P.
cybmole showed that you need 2 Capture pairs, not just the one.
Remember.you want 2 pieces so you can put them back with inserts.

[\.\!\?] could replace the \. to do this in one pass instead of the 3 , the more beginner safe way suggested by mrmikel


BTW you may have cases where there are quotation marks (straight or curly) :

".A
a."A
theducks is offline   Reply With Quote