From: Peter Szinek Date: 2007-04-07T01:59:49+09:00 Subject: Re: string scan question srinsriram@gmail.com wrote: > this is probably elementary but I just havent found the right/ > reliable way to do this (that works always) > > if a string has content in tags such as content goes here TagName> whats the best way to put the content inside an array.. the > content can have whitespace chars (end of lines tabs etc) that should > be preserved in the array element. These tags are simple (no > properties). > > I assume that the scan method is relevant but am having trouble > constructing a regex that works reliably. try html_file.scan(/(.+?) tags into an array. 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