diff --git a/ChangeLog b/ChangeLog index ff89e01981..464c711f68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 25 06:49:12 2012 Eric Hodel + + * re.c (rb_reg_s_last_match): Update $~ to reference Regexp + documentation about "special global variables". [Bug #6723] + Wed Jul 25 06:28:56 2012 Eric Hodel * iseq.c: Added documentation. Patch by David Albert. [Bug #6785] diff --git a/re.c b/re.c index 4191d5bcb8..15bdcc8ae4 100644 --- a/re.c +++ b/re.c @@ -3437,14 +3437,16 @@ match_setter(VALUE val) * Regexp.last_match -> matchdata * Regexp.last_match(n) -> str * - * The first form returns the MatchData object generated by the - * last successful pattern match. Equivalent to reading the global variable - * $~. The second form returns the nth field in this - * MatchData object. - * n can be a string or symbol to reference a named capture. + * The first form returns the MatchData object generated by the + * last successful pattern match. Equivalent to reading the special global + * variable $~ (see Special global variables in Regexp for + * details). * - * Note that the last_match is local to the thread and method scope - * of the method that did the pattern match. + * The second form returns the nth field in this MatchData object. + * _n_ can be a string or symbol to reference a named capture. + * + * Note that the last_match is local to the thread and method scope of the + * method that did the pattern match. * * /c(.)t/ =~ 'cat' #=> 0 * Regexp.last_match #=> #