From 2025346077b7a514d7fed11cac52c125e9a188c1 Mon Sep 17 00:00:00 2001 From: kosako Date: Fri, 24 Mar 2006 12:14:18 +0000 Subject: RDoc description updated git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'string.c') 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 -- cgit v1.2.3