[#114181] [Ruby master Bug#19767] [Not really a bug, but more a not ideal notification] "historical binary regexp match" when using the "n" modifier in a ruby regex — "rubyFeedback (robert heiler) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5NzY3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHJ1YnlGZWVkYmFjayAocm9iZXJ0IGhl
3 messages
2023/07/14
[ruby-core:114263] [Ruby master Bug#19746] `String#index` with regexp and too large offset doesn't clear `$~`
From:
"nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@...>
Date:
2023-07-22 04:38:51 UTC
List:
ruby-core #114263
Issue #19746 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: WONTFIX I cannot confident that there's no existing application depends on the current behavior. I don't backport the changeset. ---------------------------------------- Bug #19746: `String#index` with regexp and too large offset doesn't clear `$~` https://bugs.ruby-lang.org/issues/19746#change-103954 * Author: nobu (Nobuyoshi Nakada) * Status: Closed * Priority: Normal * Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: WONTFIX ---------------------------------------- ```ruby /./ =~ "a" p "x".index(/0/, 4) #=> nil p $~ #=> #<MatchData "a"> ``` while `rindex` does. ```ruby /./ =~ "a" p "x".rindex(/0/, 4) #=> nil p $~ #=> nil ``` It seems since 1.9. -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/