From 2025346077b7a514d7fed11cac52c125e9a188c1 Mon Sep 17 00:00:00 2001 From: kosako Date: Fri, 24 Mar 2006 12:14:18 +0000 Subject: [PATCH] RDoc description updated git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ re.c | 9 +++++++-- string.c | 23 +++++++++++++---------- version.h | 6 +++--- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index db257eae9e..2d93f76d52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Mar 24 21:11:02 2006 K.Kosako + + * 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 * re.c (rb_reg_regsub): prohibit \1, \2 ...\9 in replaced string diff --git a/re.c b/re.c index 29a84f3c5c..e0a5dd01cd 100644 --- a/re.c +++ b/re.c @@ -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---MatchData acts as an array, and may be * accessed using the normal array indexing techniques. mtch[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 = /(?a+)b/.match("ccaaab") + * m["foo"] #=> "aaa" + * m[:foo] #=> "aaa" */ static VALUE diff --git a/string.c b/string.c index 84f9e843dc..46bc40662b 100644 --- a/string.c +++ b/string.c @@ -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 replacement, special variables such as * $& will not be useful, as substitution into the string occurs * before the pattern match starts. However, the sequences \1, - * \2, etc., may be used. + * \2, \k, etc., may be used. * * In the block form, the current match string is passed in as a parameter, and * variables such as $1, $2, $`, @@ -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>') #=> "hllo" - * "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello" + * "hello".sub(/[aeiou]/, '*') #=> "h*llo" + * "hello".sub(/([aeiou])/, '<\1>') #=> "hllo" + * "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello" + * "hello".sub(/(?[aeiou])/, '*\k*') #=> "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 $& and $1) cannot be substituted into it, * as substitution into the string occurs before the pattern match - * starts. However, the sequences \1, \2, and so on - * may be used to interpolate successive groups in the match. + * starts. However, the sequences \1, \2, + * \k, 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 $1, $2, $`, @@ -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>') #=> "hll" - * "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 " + * "hello".gsub(/[aeiou]/, '*') #=> "h*ll*" + * "hello".gsub(/([aeiou])/, '<\1>') #=> "hll" + * "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 " + * "hello".gsub(/(?[aeiou])/, '{\k}') #=> "h{e}ll{o}" */ static VALUE diff --git a/version.h b/version.h index 60c681f072..4f55ce7a44 100644 --- a/version.h +++ b/version.h @@ -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[];