Thread: Regex examples
View Single Post
Old 06-02-2013, 06:41 PM   #224
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by ReaderRabbit View Post
That worked but what if the sentence ends with a '?' or '!'
the ? you need to escape with a slash, but the ! you can just drop in there.

this would work:

Code:
([a-z])([\.\?!])([A-Z])

\1\2 \3
the [] is basically looking for any one of the characters inside of it.


this is a really great reference:

http://www.regular-expressions.info/characters.html

Last edited by mzmm; 06-02-2013 at 07:01 PM. Reason: removed inaccurate information
mzmm is offline   Reply With Quote