ruby-changes:15717
From: naruse <ko1@a...>
Date: Thu, 6 May 2010 15:07:21 +0900 (JST)
Subject: [ruby-changes:15717] Ruby:r27639 (trunk): * string.c (rb_str_match_m): add description about optional
naruse 2010-05-06 15:07:05 +0900 (Thu, 06 May 2010) New Revision: 27639 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27639 Log: * string.c (rb_str_match_m): add description about optional position parameter. [ruby-list:47064] patched by KISHIMOTO, Makoto <ksmakoto AT dd.iij4u.or.jp> Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 27638) +++ ChangeLog (revision 27639) @@ -1,3 +1,9 @@ +Thu May 6 15:04:37 2010 NARUSE, Yui <naruse@r...> + + * string.c (rb_str_match_m): add description about optional + position parameter. [ruby-list:47064] + patched by KISHIMOTO, Makoto <ksmakoto AT dd.iij4u.or.jp> + Thu May 6 14:12:39 2010 Tanaka Akira <akr@f...> * lib/tmpdir.rb: test RUBY_PLATFORM for loading tmpdir.so to avoid Index: string.c =================================================================== --- string.c (revision 27638) +++ string.c (revision 27639) @@ -2555,12 +2555,15 @@ /* * call-seq: - * str.match(pattern) => matchdata or nil + * str.match(pattern) => matchdata or nil + * str.match(pattern, pos) => matchdata or nil * * Converts <i>pattern</i> to a <code>Regexp</code> (if it isn't already one), * then invokes its <code>match</code> method on <i>str</i>. If the second * parameter is present, it specifies the position in the string to begin the * search. + * If the second parameter is present, it specifies the position in the string + * to begin the search. * * 'hello'.match('(.)\1') #=> #<MatchData "ll" 1:"l"> * 'hello'.match('(.)\1')[0] #=> "ll" @@ -2586,7 +2589,7 @@ { VALUE re, result; if (argc < 1) - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); + rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc); re = argv[0]; argv[0] = str; result = rb_funcall2(get_pat(re, 0), rb_intern("match"), argc, argv); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/