From: dblack@... Date: 2003-09-24T03:26:20+09:00 Subject: Re: [newbie] upper to lower first letter of a word Hi -- On Wed, 24 Sep 2003, Yvon Thoraval wrote: > Yvon Thoraval wrote: > > > > > > string.gsub!(/\b[a-z]+/) { |w| black_list.include?(w) ? w : w.capitalize } > > > > a lot of tanxs �;) > > it seems, it's a little bit trickier because accentuated characters are > taken as \b for example : > > Vosne-roman�e > becomes : > Vosne-Roman�E I believe the /s modifier to the regex will help you here by changing the encoding, though I'm having character-rendering issues which make it hard for me to test.... But try this, in the hope that I'm right even though I can't see the characters: str.gsub!(/\b[a-z]+/s) {|w| black_list.include?(w) ? w : w.capitalize} David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav