From: dblack@... Date: 2003-09-24T06:07:08+09:00 Subject: Re: [newbie] upper to lower first letter of a word Hi -- On Wed, 24 Sep 2003, Yvon Thoraval wrote: > wrote: > > > 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} > > tanxs, i don't remember (from Perl) what's the meaning of this "s" ? It's different in Perl and Ruby. In Perl, it means: treat the string as a single line, so that '.' matches newline. In Ruby, it affects the encoding.... I wish I could give a more knowledgeable account, but I've never actually used it myself and can't seem to dig up documentation. David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav