Pattern: Use of Perl-style backreference
Issue: -
Perl-legacy variables denoting last regexp group matches ($1
, $2
, etc) are cryptic. Use Regexp.last_match(n)
instead.
/(regexp)/ =~ string
...
# bad
process $1
# good
process Regexp.last_match(1)