From: Adam Prescott Date: 2011-06-10T22:40:09+09:00 Subject: [ruby-core:36927] Re: [Ruby 1.9 - Feature #4830] Provide Default Variables for Array#each and other iterators --90e6ba6e84380f1e7104a55bb5a4 Content-Type: text/plain; charset=UTF-8 On Fri, Jun 10, 2011 at 2:32 PM, Adam Prescott wrote: > I think the ${1,2,3,...} variables match the gsub(regex, "a $1 replacement > $2 here $3"). > Sorry, that wasn't really clear, and the latter code should be \\1 not $1. I shouldn't rush! What I mean by this is that the variables have a clear association to capturing group numbers. Experience with regular expressions in Ruby and elsewhere will suggest to you what $1 will get replaced to in the block-form of gsub. The general implicit block argument $item does not, at least to me. --90e6ba6e84380f1e7104a55bb5a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Jun 10, 2011 at 2:32 PM, Adam Prescott <= span dir=3D"ltr"><adam@aprescott.c= om> wrote:
I think the ${1,2,3,...} variables match the gsub(regex, "a $1 re= placement $2 here $3").

So= rry, that wasn't really clear, and the latter code should be \\1 not $1= . I shouldn't rush!

What I mean by this is that the variables have a clear = association to capturing group numbers. Experience with regular expressions= in Ruby and elsewhere will suggest to you what $1 will get replaced to in = the block-form of gsub. The general implicit block argument $item does not,= at least to me.
--90e6ba6e84380f1e7104a55bb5a4--