Reference: rubocop/rubocop#8327 and rubocop/rubocop#10082
The follow pairs have equivalent behaviour:
array.select { |x| x.match?(REGEXP) }
array.grep(REGEXP)
array.reject { |x| x.match?(REGEXP) }
array.grep_v(REGEXP)
Previous to ruby 3, grep/grep_v had worse performance, but this was fixed by https://bugs.ruby-lang.org/issues/17030, so as of ruby 3, grep could be prefered as it is simpler.