Actions
Bug #22492
closedString#rindex misses a match with a leading .* in multiline mode
Bug #22492:
String#rindex misses a match with a leading .* in multiline mode
Description
String#rindex with a regexp starting with .* in multiline mode returns nil even when there is a match.
@make_now_just (Hiroya Fujinami) found this and wrote the fix.
Updated by mame (Yusuke Endoh) 14 days ago
Updated by mame (Yusuke Endoh) 14 days ago
- Backport changed from 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED
Updated by make_now_just (Hiroya Fujinami) 7 days ago
- Status changed from Open to Closed
Applied in changeset git|d55b67dfa3c1f94a4855381b400da7aa987bb5be.
Do not use the leading .* shortcut in a backward search
A match at an earlier position does not imply one at the start position, so String#rindex with /.*.../m missed matches.
[Bug #22492]
Updated by k0kubun (Takashi Kokubun) about 5 hours ago
- Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE
ruby_4_0 6e7a8c5dc91794681d1da4a2e9d71aebf114d955 merged revision(s) d55b67dfa3c1f94a4855381b400da7aa987bb5be.
Actions