From: eggie5 Date: 2007-09-26T14:20:08+09:00 Subject: Re: ruby regex on html file On Sep 25, 9:41 pm, "Daniel Sheppard" wrote: > > 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 Ahh, that looks beautiful right there! But will hpricot work on a .rhtml file?