From: "Rebhan, Gilbert" Date: 2007-02-23T16:36:05+09:00 Subject: File.open with line =~ /.../ Hi, i have a txtfile like that = bla1 foo=red bla2 foo=green bla3 foo=yellow and i want to get i.e. bla1 and the corresponding value of foo i tried with File.open("Y:/test/sample.txt", "r").each do |line| puts $1<<' : '<< $3 if line =~ /(\w+)\s+(\w+=)(\w+)/ end but somehow the regex doesn't work ?! whereas it works in the QuickRex Plugin for Eclipse Any ideas ? Regards, Gilbert