Issue #1749 has been updated by Akira Tanaka.


I think 1.9.2 behaviour is no problem.

String#sub matches a regexp just once.
There is no reason to set $~ at last.

String#gsub matches a regexp repeatedly until it doesn't match.
It set the last match after match failure for later use.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/1749

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