From: "kddnewton (Kevin Newton) via ruby-core" Date: 2026-11-16T17:07:58+00:00 Subject: [ruby-core:127500] [Ruby Bug#22554] /o is ignored for interpolated regexp in condition predicates Issue #22554 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Bug #22554: /o is ignored for interpolated regexp in condition predicates https://bugs.ruby-lang.org/issues/22554 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ```ruby $_ = "a" count = 0 2.times do if /#{count += 1; "a"}/o end end p count # => expected 1, actual 2 ``` as opposed to: ```ruby $_ = "a" count = 0 2.times do /#{count += 1; "a"}/o =~ $_ end p count # => expected 1, actual 1 ``` It's both compilers. -- 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/