Issue #2159 has been updated by Marc-Andre Lafortune.

Status changed from Open to Closed
Assigned to deleted (Kirk Haines)

Note that the Regexp.last_match (aka $') is local to the scope of the method that did the pattern match.

Because of this, your code is not a bug.

I've added a note to the doc to that effect.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2159

----------------------------------------
http://redmine.ruby-lang.org