From: Robert Dober Date: 2008-12-10T00:29:30+09:00 Subject: Re: pop3 body email On Tue, Dec 9, 2008 at 10:05 AM, Erika wrote: assuming that you have managed to pop your body into one string, what about the following ary = mail.scan( %r{(.*?)} ). map{ |ttext| ttext.scan( %r{(.*?)} )[0..1] } And if you want to have a hash Hash[ *ary.flatten ] and if Text2 happens to be the key Hash[ *ary.map{|x| x.reverse}.flatten ] It would be a nice exercise for you to optimize the solution for that last case ;) HTH R. -- Il computer non è una macchina intelligente che aiuta le persone stupide, anzi, è una macchina stupida che funziona solo nelle mani delle persone intelligenti. Computers are not smart to help stupid people, rather they are stupid and will work only if taken care of by smart people. Umberto Eco