1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

RDoc description updated

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosako 2006-03-24 12:14:18 +00:00
parent 50091c990d
commit 2025346077
4 changed files with 31 additions and 15 deletions

View file

@ -1,3 +1,11 @@
Fri Mar 24 21:11:02 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* re.c (match_aref): RDoc description updated.
* string.c (rb_str_sub): ditto.
* string.c (rb_str_gsub): ditto.
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* re.c (rb_reg_regsub): prohibit \1, \2 ...\9 in replaced string

9
re.c
View file

@ -5,7 +5,7 @@
$Author$
created at: Mon Aug 9 18:24:49 JST 1993
Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 1993-2006 Yukihiro Matsumoto
**********************************************************************/
@ -1177,9 +1177,10 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, char* name, char
/*
* call-seq:
* mtch[i] => obj
* mtch[i] => str or nil
* mtch[start, length] => array
* mtch[range] => array
* mtch[name] => str or nil
*
* Match Reference---<code>MatchData</code> acts as an array, and may be
* accessed using the normal array indexing techniques. <i>mtch</i>[0] is
@ -1192,6 +1193,10 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, char* name, char
* m[1, 2] #=> ["H", "X"]
* m[1..3] #=> ["H", "X", "113"]
* m[-3, 2] #=> ["X", "113"]
*
* m = /(?<foo>a+)b/.match("ccaaab")
* m["foo"] #=> "aaa"
* m[:foo] #=> "aaa"
*/
static VALUE

View file

@ -6,7 +6,7 @@
$Date$
created at: Mon Aug 9 17:12:58 JST 1993
Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 1993-2006 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
@ -1887,7 +1887,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
* If the method call specifies <i>replacement</i>, special variables such as
* <code>$&</code> will not be useful, as substitution into the string occurs
* before the pattern match starts. However, the sequences <code>\1</code>,
* <code>\2</code>, etc., may be used.
* <code>\2</code>, <code>\k<group_name></code>, etc., may be used.
*
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
@ -1897,9 +1897,10 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
* The result inherits any tainting in the original string or any supplied
* replacement string.
*
* "hello".sub(/[aeiou]/, '*') #=> "h*llo"
* "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
* "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello"
* "hello".sub(/[aeiou]/, '*') #=> "h*llo"
* "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
* "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello"
* "hello".sub(/(?<foo>[aeiou])/, '*\k<foo>*') #=> "h*e*llo"
*/
static VALUE
@ -2066,8 +2067,9 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
* If a string is used as the replacement, special variables from the match
* (such as <code>$&</code> and <code>$1</code>) cannot be substituted into it,
* as substitution into the string occurs before the pattern match
* starts. However, the sequences <code>\1</code>, <code>\2</code>, and so on
* may be used to interpolate successive groups in the match.
* starts. However, the sequences <code>\1</code>, <code>\2</code>,
* <code>\k<group_name></code>, and so on may be used to interpolate
* successive groups in the match.
*
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
@ -2077,9 +2079,10 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
* The result inherits any tainting in the original string or any supplied
* replacement string.
*
* "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
* "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
* "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 "
* "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
* "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
* "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 "
* "hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}') #=> "h{e}ll{o}"
*/
static VALUE

View file

@ -1,14 +1,14 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2006-03-23"
#define RUBY_RELEASE_DATE "2006-03-24"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20060323
#define RUBY_RELEASE_CODE 20060324
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2006
#define RUBY_RELEASE_MONTH 3
#define RUBY_RELEASE_DAY 23
#define RUBY_RELEASE_DAY 24
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];