mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
string.c: docs for String#match
* string.c: [DOC] add example for String#match with pos argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4a0eaeeb4d
commit
8303bc6cf6
1 changed files with 1 additions and 0 deletions
1
string.c
1
string.c
|
@ -3657,6 +3657,7 @@ static VALUE get_pat(VALUE);
|
|||
* 'hello'.match('(.)\1') #=> #<MatchData "ll" 1:"l">
|
||||
* 'hello'.match('(.)\1')[0] #=> "ll"
|
||||
* 'hello'.match(/(.)\1/)[0] #=> "ll"
|
||||
* 'hello'.match(/(.)\1/, 3) #=> nil
|
||||
* 'hello'.match('xx') #=> nil
|
||||
*
|
||||
* If a block is given, invoke the block with MatchData if match succeed, so
|
||||
|
|
Loading…
Reference in a new issue