From: Daniel Sheppard Date: 2007-09-26T13:41:13+09:00 Subject: Re: ruby regex on html file > I'm trying to write a rake task to extract all the script tags out of > my html file and save them to an array. How can I do this? Your subject says regex, but your request says Hpricot: require 'hpricot' doc = Hpricot(input) scripts = (doc/'script').map {|x| x['src']}.compact