Thread: Regex examples
View Single Post
Old 08-08-2014, 12:33 PM   #376
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by mzmm View Post
is that working for you in sigil? my PCRE editor doesn't match

i'd probably use something like

find
Code:
(?<![.!?])( [A-Z])(?=[a-z])
replace
Code:
\U\1\E


but yes, some examples of exactly want to match would help, it's a little unclear
Yes, I forgot some things, like the part where lookbehinds need to look behind.

Find:
Code:
(?<![.!?])(?<=[ ])([A-Z])(?=[a-z]+)
Replace. Keep in mind that \E -- end of modifier's action -- is not strictly necessary if the entire replacement is being flagged as lowercase:
Code:
\L\1
This time I actually checked in Sigil.

You lost a space. Also, you imitated my mistake of offering an uppercasing solution (for letters that are already uppercase ) instead of lowercasing. I blame my dental surgery, what's your excuse? (You can blame it on me, I did trick you. )

Last edited by eschwartz; 08-08-2014 at 12:43 PM.
eschwartz is offline   Reply With Quote