[#86787] [Ruby trunk Feature#14723] [WIP] sleepy GC — ko1@...

Issue #14723 has been updated by ko1 (Koichi Sasada).

13 messages 2018/05/01
[#86790] Re: [Ruby trunk Feature#14723] [WIP] sleepy GC — Eric Wong <normalperson@...> 2018/05/01

ko1@atdot.net wrote:

[#87095] [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — ko1@...

Issue #14767 has been updated by ko1 (Koichi Sasada).

9 messages 2018/05/17
[#87096] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — Eric Wong <normalperson@...> 2018/05/17

ko1@atdot.net wrote:

[ruby-core:87279] [Ruby trunk Bug#14791] String.sub wrong parsing of replacement with capturing group

From: hanmac@...
Date: 2018-05-28 14:01:37 UTC
List: ruby-core #87279
Issue #14791 has been updated by Hanmac (Hans Mackowiak).


read the Docs:

~~~
If replacement is a String it will be substituted for the matched text. It may contain back-references to the pattern's capture groups of the form "\d", where d is a group number, or "\k<n>", where n is a group name. If it is a double-quoted string, both back-references must be preceded by an additional backslash.
~~~

it is explained what to do with the blackslashes. and how much do you need.


----------------------------------------
Bug #14791: String.sub wrong parsing of replacement with capturing group
https://bugs.ruby-lang.org/issues/14791#change-72266

* Author: churib (Timo Grodzinski)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
~~~ ruby
irb(main):001:0> "abc".sub(/(b)/, '#\1#') # works
=> "a#b#c"
irb(main):002:0> "abc".sub(/(b)/, '\\1') # doesn't works, should be "a\bc"
=> "abc"
irb(main):003:0> "abc".sub(/(b)/, '\\\1') # doesn't works, should be "a\\bc"
=> "a\\1c"
irb(main):004:0> "abc".sub(/(b)/, "\\1") # works
=> "abc"
irb(main):005:0> "abc".sub(/(b)/, "\\\\1") # doesn't works, should be "a\bc"
=> "a\\1c"
irb(main):006:0> "abc".sub(/(b)/, '\ \1') # works
=> "a\ bc"
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next