From: Robert Klemme Date: 2012-07-19T00:18:30+09:00 Subject: Re: Message from user jon_r45 On Tue, Jul 17, 2012 at 4:36 PM, wrote: > jon_r45 sent you the following message: > > ==================================== > Do you mind explaining to me how the code > > {|l| l[/^\s*([^:\s]+)/, 1]} > > gets me what I want. I still don't see how the : and everything after > it is being dropped. > ==================================== This is a code block which is used with #map in my code snippet. It will convert the line into the leading portion. The main trick here is method String#[] with a regular expression and a group index which selects the portion of the match to be returned. I recommend to decompose the code and try out individual parts in IRB so you get familiar with how it works. Cheers robert PS: Please do not ask via private email. -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/