summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-24 12:14:18 +0000
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-24 12:14:18 +0000
commit2025346077b7a514d7fed11cac52c125e9a188c1 (patch)
tree7ebaf81674e4d61289c3aeb42b546f5fcf21c62c
parent50091c990d268285097b2be5ce5331317227ba0c (diff)
RDoc description updated
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--re.c9
-rw-r--r--string.c23
-rw-r--r--version.h6
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 <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
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---<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
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 <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
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[];