From: Double Minus Date: 2008-10-17T03:05:51+09:00 Subject: Shoes GUI - downloading site, using reg exs on body So I want my app to download the text of a site's body (easy) and then I want to use regular expressions to pick out chunks of text. In my very limited skills/knowledge, I've had a hard time getting this working. I've tried two approaches... Code: Shoes.app do stack :left => 65, :top => 75 do @results = para "results" end stack (:left => 165, :top => 180) do para "URL:" flow do button "Clear" do @status.replace "results cleared..." and @searching.replace " " and @results.replace "results" end @url = edit_line "http://www.google.com/" button "OK" do stack do @searching = title "Searching site", :size => 16 @status = para "One moment..." download @url.text do |site| @status.text = "Body: " + site.response.body.inspect regex = Regexp.new(/http/) matchdata = @status.text if matchdata @results.text = matchdata[1] else @results.text = "NO MATCH" end end end end end end end That doesn't work. This is the other approach: @status.text = "Body: " + site.response.body.inspect if @status.text =~ /html/ then @results.text = $1 Any advice/guidance? Am I even on the right track? double -- Posted via http://www.ruby-forum.com/.