Project

General

Profile

Actions

Backport #8023

closed

Lookbehind assertion fails with /m mode enabled

Added by pietzcker (Tim Pietzcker) over 11 years ago. Updated over 11 years ago.


Description

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


Related issues 1 (0 open1 closed)

Related to Backport193 - Backport #8076: Lookbehind assertion fails with /m mode enabledClosedusa (Usaku NAKAMURA)03/06/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0