Issue #8023 has been reported by pietzcker (Tim Pietzcker).

----------------------------------------
Bug #8023: Lookbehind assertion fails with /m mode enabled
https://bugs.ruby-lang.org/issues/8023

Author: pietzcker (Tim Pietzcker)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


Lookbehind assertions fail if they are longer than one character, and if dotall mode is set.

irb(main):001:0> "foo" =~ /(?<=f).*/m
=> 1
irb(main):002:0> "foo" =~ /(?<=fo).*/m
=> nil

The latter should have matched the "o". This only seems to happen with dotall mode turned on (dot matches newline); without it, everything is OK:

irb(main):003:0> "foo" =~ /(?<=f).*/
=> 1
irb(main):004:0> "foo" =~ /(?<=fo).*/
=> 2


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