[thelist] Regex apostrophe problem

fstorr fffrancis at fstorr.demon.co.uk
Wed Aug 17 09:11:19 CDT 2005


Hi all

I'm trying to write a regex that will change the case of text from  
all upper to title case so, from BOB O'NEIL to Bob O'Neil.  I'm  
getting stuck where apostrophes come into play as the N after the  
apostrophe needs to be capitalised along with the preceding O.  I've  
got this so far:

Find: ([\w]{1})([\w]+)
Replace: $1\L\$

But don't know how to deal with the apostrophes.  Is it possible to  
do this, and if so, how?

regards

Francis



More information about the thelist mailing list