From: Peter Szinek Date: 2007-04-07T02:27:02+09:00 Subject: Re: string scan question srinsriram@gmail.com wrote: > Here is a simple test case > > s = \nXXX\n\n\n > \n Administrative Support - Supervisors\n VariableValue>\n\n" > > for the VariableValue tag, there should be 2 array elements \nXXX > \n AND \n Administrative Support - Supervisors\n > > s.scan(/(.+?)(.+?)<\/VariableValue>/m).flatten (note the 'm' flag for multiline) however, to really match your example, I needed this: s.scan(/(.+?)<\/\n?VariableValue>/m).flatten are you sure there is a line break between / and the tag name? Cheers, Peter -- http://www.rubyrailways.com :: Ruby and Web2.0 blog http://scrubyt.org :: Ruby web scraping framework http://rubykitchensink.ca/ :: The indexed archive of all things Ruby