From: ts Date: 2001-04-22T02:28:55+09:00 Subject: [ruby-talk:13993] Re: regexp problem ... >>>>> "J" == Jens Luedicke writes: J> io = IO.popen("wget --dot-style=micro " + url) First I need to redirect stderr on stdout, i.e. io = IO.popen("wget --dot-style=micro " + url + " 2>&1") J> out = io.readlines J> for i in out J> print /(.)(\d+)(%]\n)/.match(i)[2], "\n" Best to write it like this if /(.)(\d+)(%]\n)/ =~ i puts $2 end If the regexp don't match #match will return nil, and ruby will give an error message (method [] not found for nil) Guy Decoux