in reply to Re^3: Capitalize First Letter of Each Word
in thread Capitalize First Letter of Each Word

s#\b(\w)(\w* ?)#\U$1\L$2#g
does the trick.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^5: Capitalize First Letter of Each Word
by suaveant (Parson) on Jun 30, 2005 at 14:36 UTC
    That finishing space is completely extraneous... the \b at the front basically is as well. Space is not a word char, so will be just fine if left alone. The \w at the beginning is basically implying \b, since it will only start to match where a word char is.

                    - Ant
                    - Some of my best work - (1 2 3)