From: Mark Thomas Date: 2008-02-29T03:54:55+09:00 Subject: Re: Need a regex searching html code A regex will break too easily when parsing HTML. A real parser will do a much better job, and often be more concise and readable, too. This does what you want: #------- require 'rubygems' require 'hpricot' @doc = Hpricot(html) # or Hpricot(open("filename")) def find(term) @doc.search("//div[@class='info']").each do |info| header = info.search("h5").remove if header.inner_text == term puts info.inner_html end end end #------- > find("Plot Outline:") John McClane takes on an Internet-based terrorist organization who is systematically shutting down the United States. more Mark