From: Chad Perrin Date: 2006-01-04T09:41:43+09:00 Subject: Re: silly regex question On Wed, Jan 04, 2006 at 07:51:55AM +0900, James Edward Gray II wrote: > > def process_string str > str.inject(Hash.new) do |result, line| > result[$1] = line if line =~ /^\s*important ([^:]+):/ > result > end > end Not that I'm the one that has to read it, but . . . I like this one for readability. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] unix virus: If you're using a unixlike OS, please forward this to 20 others and erase your system partition.