> Arg, line wrapping was too aggressive there... > > channelBlocks = Regexp.new( > '<table width="132" border="0" cellpadding="0" ' + > 'cellspacing="0">(.*)</table>', > Regexp::MULTILINE > ) Thanks, just a slight problem, I want it to match from the start of the <table width="132" ... > tag to the next </table> tag, but I think Ruby matched it with the last </table> tag in the file. In the file, there're 3 of these tables with width 132, I want to extract those three tables. This is what I have so far: file = File.new('your_tv_guide.txt', 'r') s = file.read file.close #puts s regex = Regexp.new( '<table width="132" border="0" cellpadding="0" cellspacing="0">(.*)</table>', Regexp::MULTILINE ) channelBlocks = s.scan(regex) channelBlocks.each do |s| puts s end