mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (last_match): Added note to the doc that last_match is local to current scope [ruby-core:25833]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40e50764f4
commit
b59109a844
1 changed files with 3 additions and 0 deletions
3
re.c
3
re.c
|
@ -3392,6 +3392,9 @@ match_setter(VALUE val)
|
|||
* <code>MatchData</code> object.
|
||||
* <em>n</em> can be a string or symbol to reference a named capture.
|
||||
*
|
||||
* Note that the <code>last_match</code> is local to the scope
|
||||
* of the method that did the pattern match.
|
||||
*
|
||||
* /c(.)t/ =~ 'cat' #=> 0
|
||||
* Regexp.last_match #=> #<MatchData "cat" 1:"a">
|
||||
* Regexp.last_match(0) #=> "cat"
|
||||
|
|
Loading…
Reference in a new issue