summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 21:49:31 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 21:49:31 +0000
commita10f6137cc11598bab093ee694224cf4b5b15eb7 (patch)
treea3e9f662ae818b09b8d44bc039c523cee0f1dc5e /re.c
parentea6da56a655c115d82e04f42c6a74ab05d8e2721 (diff)
* re.c (rb_reg_s_last_match): Update $~ to reference Regexp
documentation about "special global variables". [Bug #6723] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c16
1 files changed, 9 insertions, 7 deletions
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 <code>MatchData</code> object generated by the
- * last successful pattern match. Equivalent to reading the global variable
- * <code>$~</code>. The second form returns the <i>n</i>th field in this
- * <code>MatchData</code> object.
- * <em>n</em> 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 <code>$~</code> (see Special global variables in Regexp for
+ * details).
+ *
+ * The second form returns the <i>n</i>th field in this MatchData object.
+ * _n_ can be a string or symbol to reference a named capture.
*
- * Note that the <code>last_match</code> is local to the thread and method scope
- * of the method that did the pattern match.
+ * 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 #=> #<MatchData "cat" 1:"a">