--- ruby-1.8.7-p173/string.c.orig 2009-02-17 02:59:26.000000000 +0000 +++ ruby-1.8.7-p173/string.c 2010-01-20 19:10:04.718058600 +0000 @@ -3515,7 +3515,9 @@ * * If pattern is a Regexp, str is divided where the * pattern matches. Whenever the pattern matches a zero-length string, - * str is split into individual characters. + * str is split into individual characters. If + * pattern includes one or more capturing subpatterns, + * these will be returned in the array returned by split. * * If pattern is omitted, the value of $; is used. If * $; is nil (which is the default), str is @@ -3532,6 +3534,8 @@ * " now's the time".split(' ') #=> ["now's", "the", "time"] * " now's the time".split(/ /) #=> ["", "now's", "", "the", "time"] * "1, 2.34,56, 7".split(%r{,\s*}) #=> ["1", "2.34", "56", "7"] + * "1, 2.34,56".split(%r{(,\s*)}) #=> ["1", ", ", "2.34", ",", "56"] + * "wd :sp: wd".split(/(:(\w+):)/) #=> ["wd ", ":sp:", "sp", " wd"] * "hello".split(//) #=> ["h", "e", "l", "l", "o"] * "hello".split(//, 3) #=> ["h", "e", "llo"] * "hi mom".split(%r{\s*}) #=> ["h", "i", "m", "o", "m"]