Message from discussion
splitting with a regex & keeping a ref?
Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.cs.univ-paris8.fr!talisker.lacave.net!lacave.net!not-for-mail
From: Kyle Schmitt <kyleaschm...@gmail.com>
Newsgroups: comp.lang.ruby
Subject: Re: splitting with a regex & keeping a ref?
Date: Thu, 1 May 2008 10:44:29 -0500
Organization: Service de news de lacave.net
Lines: 23
Message-ID: <2b548b8b0805010844k2e55e226l5fdf64c91ddb1458@mail.gmail.com>
References: <2b548b8b0805010746o4cca030cvc8929394341ed67a@mail.gmail.com>
<Pine.LNX.4.64.0805011054440.19634@rubypal.com>
<2b548b8b0805010813i1ee5399cye956bc657b20a4f3@mail.gmail.com>
<2b548b8b0805010817p1a733e16rab2b097a96686993@mail.gmail.com>
NNTP-Posting-Host: bristol.highgroove.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: talisker.lacave.net 1209656687 24027 65.111.164.187 (1 May 2008 15:44:47 GMT)
X-Complaints-To: abuse@lacave.net
NNTP-Posting-Date: Thu, 1 May 2008 15:44:47 +0000 (UTC)
In-Reply-To: <2b548b8b0805010817p1a733e16rab2b097a96686993@mail.gmail.com>
X-Received-From: This message has been automatically forwarded from the
ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did
not originate at comp.lang.ruby. Please report the original sender, and not
us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count: 300276
X-Ml-Name: ruby-talk
X-Rubymirror: Yes
X-Ruby-Talk: <2b548b8b0805010844k2e55e226l5fdf64c91ddb1...@mail.gmail.com>
David,
re-reading your sig, and that page, I've got to apologize,
you already knew that stuff in spades I'm sure! :)
What part doesn't quite make sense?
On Thu, May 1, 2008 at 10:17 AM, Kyle Schmitt <kyleaschm...@gmail.com> wrote:
> Ohh right, desired sample output.
>
> What I'd really like, is to split the string, and either stuff it
> straight into a hash at the same time, or, more realistically since
> it's splitting, array tuples.
> So...
>
> sample.data.split(){magic happens here}
> =>{"[shop]"=>"\ncomment = shared directory for the shop\npath..>"}
>
> or
> sample.data.split(){magick happens here}
> =>[["[shop]","\ncomment = shared directory for the shop\npath..>"]]
>
>