diff options
author | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-03-24 12:14:18 +0000 |
---|---|---|
committer | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-03-24 12:14:18 +0000 |
commit | 2025346077b7a514d7fed11cac52c125e9a188c1 (patch) | |
tree | 7ebaf81674e4d61289c3aeb42b546f5fcf21c62c /re.c | |
parent | 50091c990d268285097b2be5ce5331317227ba0c (diff) | |
download | ruby-2025346077b7a514d7fed11cac52c125e9a188c1.tar.gz |
RDoc description updated
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 |