ruby-changes:38428
From: hsbt <ko1@a...>
Date: Sat, 16 May 2015 21:41:38 +0900 (JST)
Subject: [ruby-changes:38428] hsbt:r50509 (trunk): * string.c: added documentation for character sequence \' with String#sub
hsbt 2015-05-16 21:41:29 +0900 (Sat, 16 May 2015) New Revision: 50509 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50509 Log: * string.c: added documentation for character sequence \' with String#sub [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127 Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50508) +++ ChangeLog (revision 50509) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat May 16 21:41:24 2015 SHIBATA Hiroshi <hsbt@r...> + + * string.c: added documentation for character sequence \' with String#sub + [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127 + Sat May 16 21:38:05 2015 SHIBATA Hiroshi <hsbt@r...> * enum.c: fix a sample code. Patch by @eagletmt Index: string.c =================================================================== --- string.c (revision 50508) +++ string.c (revision 50509) @@ -4310,6 +4310,9 @@ rb_str_sub_bang(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/string.c#L4310 * double-quoted string, both back-references must be preceded by an * additional backslash. However, within +replacement+ the special match * variables, such as <code>&$</code>, will not refer to the current match. + * If +replacement+ is a String that looks like a pattern's capture group but + * is actaully not a pattern capture group e.g. <code>"\\'"</code>, then it + * will have to be preceded by two backslashes like so <code>"\\\\'"</code>. * * If the second argument is a Hash, and the matched text is one of its keys, * the corresponding value is the replacement string. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/