1
0
Fork 0
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:
stomar 2017-05-11 18:59:45 +00:00
parent 4a0eaeeb4d
commit 8303bc6cf6

View file

@ -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