On Fri, Jun 10, 2011 at 2:32 PM, Adam Prescott <adam / aprescott.com> 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.