From: Kirk Haines Date: 2009-08-07T00:50:03+09:00 Subject: [ruby-core:24797] Re: Proposal: match? with no backrefs On Tue, Aug 4, 2009 at 9:37 PM, NARUSE, Yui wrote: > 2009/08/03 9:04, Yehuda Katz wrote: >> >> In both of those cases, $1 is set. > > $1 is virtual variable. > The value of $1 is created when it is called. I think what Yehuda is getting at, though, is that: 'abcdefghijklmnopqrstuvwxyz' =~ /nop/ is quite a bit faster than: 'abcdefghijklmnopqrstuvwxyz' =~ /n(op)/ So it would be nice to be able to: r = /n(op)/ 'abcdefghijklmnopqrstuvwxyz'.match?(r) And have that run as fast as a /nop/ version, since it need not actually act on the backreference creation in this instance. Did I interpret your intent correctly, Yehuda? Kirk Haines