[ruby-core:127500] [Ruby Bug#22554] /o is ignored for interpolated regexp in condition predicates
16 Nov
2026
16 Nov
'26
5:07 p.m.
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/
6
Age (days ago)
6
Last active (days ago)
0 comments
1 participants
participants (1)
-
kddnewton (Kevin Newton)