Fixing named captures not being original class
Fixing named captures not being original class

Subclassing String and applying a Regexp.match on it will result in
named captures ($1...9, $`, $+, $&) that are of class String, not the
original subclass.

This incorrect behavior is illustrated here:
  class MyString < String; end
  /(name)/ =~ MyString.new("name")

  $1.class
  => String

This patch corrects this behavior to:
  class MyString < String; end
  /(name)/ =~ MyString.new("name")

  $1.class
  => MyString

To fix this problem, the MatchData functions now change the klass of
their output strings to that of the MatchData's original source string
before returning.

benlovell/rubinius,sferik/rubinius,heftig/rubinius,pH14/rubinius,Wirachmat/rubinius,dblock/rubinius,sferik/rubinius,pH14/rubinius,pH14/rubinius,dblock/rubinius,jsyeo/rubinius,Wirachmat/rubinius,ruipserra/rubinius,digitalextremist/rubinius,jsyeo/rubinius,jemc/rubinius,mlarraz/rubinius,sferik/rubinius,dblock/rubinius,pH14/rubinius,benlovell/rubinius,benlovell/rubinius,sferik/rubinius,ngpestelos/rubinius,jemc/rubinius,kachick/rubinius,digitalextremist/rubinius,heftig/rubinius,pH14/rubinius,jsyeo/rubinius,benlovell/rubinius,Azizou/rubinius,ruipserra/rubinius,jemc/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,digitalextremist/rubinius,heftig/rubinius,dblock/rubinius,Wirachmat/rubinius,benlovell/rubinius,digitalextremist/rubinius,Wirachmat/rubinius,sferik/rubinius,ruipserra/rubinius,Azizou/rubinius,kachick/rubinius,Wirachmat/rubinius,Azizou/rubinius,jsyeo/rubinius,heftig/rubinius,digitalextremist/rubinius,jemc/rubinius,kachick/rubinius,Wirachmat/rubinius,kachick/rubinius,jsyeo/rubinius,heftig/rubinius,jemc/rubinius,ngpestelos/rubinius,Azizou/rubinius,ruipserra/rubinius,kachick/rubinius,ngpestelos/rubinius,Azizou/rubinius,heftig/rubinius,pH14/rubinius,mlarraz/rubinius,jemc/rubinius,digitalextremist/rubinius,jsyeo/rubinius,dblock/rubinius,benlovell/rubinius,benlovell/rubinius,kachick/rubinius,dblock/rubinius,ngpestelos/rubinius,dblock/rubinius,kachick/rubinius,Azizou/rubinius,jemc/rubinius,mlarraz/rubinius,pH14/rubinius,digitalextremist/rubinius,ruipserra/rubinius,jsyeo/rubinius,mlarraz/rubinius,mlarraz/rubinius,ruipserra/rubinius,sferik/rubinius,mlarraz/rubinius,ruipserra/rubinius,heftig/rubinius,kachick/rubinius,Azizou/rubinius,mlarraz/rubinius,sferik/rubinius,Wirachmat/rubinius,ngpestelos/rubinius