fork download
  1. options = ["arish1", "arish2", "ARISH3", "arish 2", "arish"]
  2. choices = ["Arish"]
  3. final_choice = options.grep(/\A(?:#{Regexp.union(choices).source})\z/i)
  4. p final_choice
  5.  
  6. #Output: ["arish1", "arish2", "ARISH3", "arish 2", "arish"]
Success #stdin #stdout 0.01s 6428KB
stdin
Standard input is empty
stdout
["arish"]