-
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected behavior
MatchData is used, so this shouldn't be reported.
$ ruby a.rb
o
Actual behavior
a.rb:1:12: C: [Correctable] Performance/RedundantMatch: Use =~ in places where the MatchData returned by #match will not be used.
puts $~ if 'foxes'.match(/[aeiouy]/)
^^^^^^^^^^^^^^^^^^^^^^^^^
Steps to reproduce the problem
puts $~ if 'foxes'.match(/[aeiouy]/)`
RuboCop version
rubocop-performance (1.25.0)
ruby 2025-08-01 30a20bc16
rubocop 2025-08-11 c595cf6e2
System Version: macOS 15.6 (24G84)
Model Identifier: MacBookAir10,1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working