mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
update document to follow MatchData#inspect implementation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
18ee945174
commit
fe377d3b8e
2 changed files with 2 additions and 2 deletions
2
re.c
2
re.c
|
@ -2313,7 +2313,7 @@ match_setter(VALUE val)
|
|||
* <code>MatchData</code> object.
|
||||
*
|
||||
* /c(.)t/ =~ 'cat' #=> 0
|
||||
* Regexp.last_match #=> #<MatchData:0x401b3d30>
|
||||
* Regexp.last_match #=> #<MatchData "cat" "a">
|
||||
* Regexp.last_match(0) #=> "cat"
|
||||
* Regexp.last_match(1) #=> "a"
|
||||
* Regexp.last_match(2) #=> nil
|
||||
|
|
2
string.c
2
string.c
|
@ -1423,7 +1423,7 @@ static VALUE get_pat(VALUE, int);
|
|||
* parameter is present, it specifies the position in the string to begin the
|
||||
* search.
|
||||
*
|
||||
* 'hello'.match('(.)\1') #=> #<MatchData:0x401b3d30>
|
||||
* 'hello'.match('(.)\1') #=> #<MatchData "ll" "l">
|
||||
* 'hello'.match('(.)\1')[0] #=> "ll"
|
||||
* 'hello'.match(/(.)\1/)[0] #=> "ll"
|
||||
* 'hello'.match('xx') #=> nil
|
||||
|
|
Loading…
Reference in a new issue