[ruby-core:88456] [Ruby trunk Bug#14707] String#scan(/\K/) has changed its behavior in ruby 2.5

From: nagachika00@...
Date: 2018-08-12 11:51:10 UTC
List: ruby-core #88456
Issue #14707 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r64320 merged revision(s) 63252.

----------------------------------------
Bug #14707: String#scan(/\K/) has changed its behavior in ruby 2.5
https://bugs.ruby-lang.org/issues/14707#change-73522

* Author: knu (Akinori MUSHA)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p59 (2018-03-31 revision 63049) [x86_64-darwin17]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE
----------------------------------------
It seems `\K` does not work as expected any more:

```
% ruby -ve 'p "a1 a2 a3".scan(/a\K./)'

ruby 2.3.7p456 (2018-03-28 revision 63014) [x86_64-darwin17]
["1", "2", "3"]

ruby 2.4.5p297 (2018-03-29 revision 63036) [x86_64-darwin17]
["1", "2", "3"]

ruby 2.5.1p59 (2018-03-31 revision 63049) [x86_64-darwin17]
["a1", "a2", "a3"]
```

I'm not sure if this is intended, but at least there is no mention for this in the NEWS file.



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

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next