From 5ffb21ebbd37bbb71b9c6f25c9c621cb3f037a1b Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 16 May 2015 12:41:29 +0000 Subject: * string.c: added documentation for character sequence \' with String#sub [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index eeb30cea86..b9b1660d63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 16 21:41:24 2015 SHIBATA Hiroshi + + * 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 * enum.c: fix a sample code. Patch by @eagletmt diff --git a/string.c b/string.c index 943c18c140..ca085405c0 100644 --- a/string.c +++ b/string.c @@ -4310,6 +4310,9 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str) * double-quoted string, both back-references must be preceded by an * additional backslash. However, within +replacement+ the special match * variables, such as &$, 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. "\\'", then it + * will have to be preceded by two backslashes like so "\\\\'". * * If the second argument is a Hash, and the matched text is one of its keys, * the corresponding value is the replacement string. -- cgit v1.2.3