From: Harry Date: 2007-03-18T21:01:55+09:00 Subject: Re: Another RegExp question On 3/18/07, J. mp wrote: > sample = "thi's is a tes<>%$#!|t" > > what I want is use sample.sub(\['<>%$#!|]\,"") > and the outcome shoudl be > > "this is a test" > > But I only can replace the first occurence of the chars specified in the > reg exp > > How can I replace all occurences? > > Thnaks, > > -- > Posted via http://www.ruby-forum.com/. > > Will this work ? sample = "thi's is a tes<>%$###!!!!!###!|t" x = sample.gsub(/[\''<>%$#!\|]/,"") puts x Harry -- http://www.kakueki.com/ruby/list.html Japanese Ruby List Subjects in English