Pattern: Out of range Regexp reference
Issue: -
This cops looks for references of Regexp captures that are out of range and thus always returns nil.
/(foo)bar/ =~ 'foobar'
# bad - always returns nil
puts $2 # => nil
# good
puts $1 # => foo
Pattern: Out of range Regexp reference
Issue: -
This cops looks for references of Regexp captures that are out of range and thus always returns nil.
/(foo)bar/ =~ 'foobar'
# bad - always returns nil
puts $2 # => nil
# good
puts $1 # => foo