From: Kent Dahl Date: 2003-05-10T22:26:34+09:00 Subject: Re: Extracting text from HTML Robo wrote: > channelBlocks = s.scan(/ cellspacing=\"0\">(.*?)<\/table>/) > > channelBlocks.each do |s| > puts s > end > > But it doesn't work, is it because the match is span across multiple lines > in the HTML? If so, what's the best method to solve it? Yes, it is due to the multiple lines. Try channelBlocks = Regexp.new( '
(.*)
', Regexp::MULTILINE ) Watch out for greed and nested tables, though. I gave up on trying to make the literal Regexp work, escaping things by hand is a real chore. :-P HTH -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)