From: Aredridel Date: 2003-06-25T23:36:36+09:00 Subject: Re: another problem with regular expressions On Wed, 2003-06-25 at 00:38, Rob wrote: > I have an array with the following elements: > > array[0] = "car" > array[1] = "bike" > array[2] = "motorcicle" > ....... > array[n] = ......... > > And I have a string with the following text. > > "Today I went to school by car. I saw............ " > > What I am trying to do is that everytime the program finds one of the words > from the list in the text, > it will place an astherisc * to replace that word. > sentence.gsub!(Regexp.new(array.join('|')), '*') Ari