ruby-changes:46554
From: stomar <ko1@a...>
Date: Fri, 12 May 2017 03:59:49 +0900 (JST)
Subject: [ruby-changes:46554] stomar:r58669 (trunk): string.c: docs for String#match
stomar 2017-05-12 03:59:45 +0900 (Fri, 12 May 2017) New Revision: 58669 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58669 Log: string.c: docs for String#match * string.c: [DOC] add example for String#match with pos argument. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 58668) +++ string.c (revision 58669) @@ -3657,6 +3657,7 @@ static VALUE get_pat(VALUE); https://github.com/ruby/ruby/blob/trunk/string.c#L3657 * '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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/