From: "David A. Black" Date: 2007-09-24T04:41:29+09:00 Subject: Re: Split into hash Hi -- On Mon, 24 Sep 2007, Sebastian Hungerecker wrote: > Felix Windt wrote: >>> From: Sebastian Hungerecker [mailto:sepp2k@googlemail.com] >>> Hash[*File.read(filename).scan(/^.*=.*$/).flatten] >> >> I believe that should be: >> >> Hash[*File.read(filename).scan(/^(.*)=(.*)$/).flatten] > > Yes, it should - sorry about that. Usually I test code before posting it. I think it's exactly (?) equivalent to: Hash[*File.read(filename).scan(/[^=\n]+/)] if you want to save the flattening operation. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!