[#69084] [Ruby trunk - Feature #11124] [Open] [PATCH] lib/*: use monotonic clock for timeouts — normalperson@...
Issue #11124 has been reported by Eric Wong.
5 messages
2015/05/06
[#69138] [Ruby trunk - Feature #11136] [PATCH] webrick: avoid fcntl module — nobu@...
Issue #11136 has been updated by Nobuyoshi Nakada.
3 messages
2015/05/12
[#69160] [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start — nobu@...
Issue #11146 has been updated by Nobuyoshi Nakada.
4 messages
2015/05/13
[#69175] Re: [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start
— Eric Wong <normalperson@...>
2015/05/13
nobu@ruby-lang.org wrote:
[ruby-core:69261] [Ruby trunk - Bug #11132] String#sub and character sequence \' in replacement string
From:
usa@...
Date:
2015-05-21 01:37:06 UTC
List:
ruby-core #69261
Issue #11132 has been updated by Usaku NAKAMURA. Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED ---------------------------------------- Bug #11132: String#sub and character sequence \' in replacement string https://bugs.ruby-lang.org/issues/11132#change-52515 * Author: Thomas Leitner * Status: Closed * Priority: Normal * Assignee: * ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] * Backport: 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED ---------------------------------------- Hi, I don't know if this is intentional but substitution of `\'` and `` \` `` in the replacement string was rather unexpected for me: ~~~ 2.2.2 :001 > "this is a test".sub(/this/, "some text \\'") => "some text is a test is a test" ~~~ I would have expected the following result: ~~~ => "some text \\' is a test" ~~~ The documentation says nothing about this, just that back-references can be used (i.e. `\\d` or `\\k<n>`). A work-around is escaping the escape character: ~~~ 2.2.2 :001 > "this is a test".sub(/this/, "some text \\\\'") => "some text \\' is a test" ~~~ Thanks! -- https://bugs.ruby-lang.org/