我想用精确的字符串匹配两个数组之间的选项。
options = ["arish1", "arish2", "ARISH3", "arish 2", "arish"]
choices = ["Arish"]
final_choice = options.grep(Regexp.new(choices.join('|'), Regexp::IGNORECASE))
p final_choice
Output:
["arish1", "arish2", "ARISH3", "arish 2", "arish"]
but it should be only match "arish"