Thread: Regex examples
View Single Post
Old 07-28-2013, 01:58 PM   #271
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16078357
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by Doitsu View Post
I'm sure that there's a more elegant solution, but the following simple regex should work:

Find: ([[:upper:]]{1,})([[:lower:]]+)
Replace: \1<small>\U\2\E</small>

Since this simple regex will find title case strings everywhere, you can't use it with Replace All, though.

To replace two consecutive title case words use the following regex:

Find: ([[:upper:]]{1,})([[:lower:]]+) ([[:upper:]]{1,})([[:lower:]]+)
Replace: \1<small>\U\2\E</small> \3<small>\U\4\E</small>
Thank you sir. I will give it a try.
crutledge is offline   Reply With Quote