Project

General

Profile

Actions

Bug #22492

open

String#rindex misses a match with a leading .* in multiline mode

Bug #22492: String#rindex misses a match with a leading .* in multiline mode

Added by mame (Yusuke Endoh) 4 days ago. Updated 4 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:127294]

Description

String#rindex with a regexp starting with .* in multiline mode returns nil even when there is a match.

"xab".rindex(/.*b/m) #=> nil (expected: 2)
"xab".rindex(/.*b/)  #=> 2

@make_now_just (Hiroya Fujinami) found this and wrote the fix.

Actions

Also available in: PDF Atom