From: "mame (Yusuke Endoh) via ruby-core" Date: 2026-11-02T12:57:13+00:00 Subject: [ruby-core:127294] [Ruby Bug#22492] String#rindex misses a match with a leading .* in multiline mode Issue #22492 has been reported by mame (Yusuke Endoh). ---------------------------------------- Bug #22492: String#rindex misses a match with a leading .* in multiline mode https://bugs.ruby-lang.org/issues/22492 * Author: mame (Yusuke Endoh) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- `String#rindex` with a regexp starting with `.*` in multiline mode returns `nil` even when there is a match. ```ruby "xab".rindex(/.*b/m) #=> nil (expected: 2) "xab".rindex(/.*b/) #=> 2 ``` @make_now_just found this and wrote the fix. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/