Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2016 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f30f757084bb961965f2093d40f5eda8 to your computer and use it in GitHub Desktop.
Save anonymous/f30f757084bb961965f2093d40f5eda8 to your computer and use it in GitHub Desktop.
cons = [ { "FirstName" => "Bill", "LastName" => "Wingy", "Phone1" => "(800) 552-3209", "Phone2" => "828 283-1134" }, { "FirstName" => "Ted", "LastName" => "Dimble", "Phone1" => "(823) 813-2834", "Phone2" => "8823 232-2342" } ]
pait_nums = ["8282831134", "8282831132344"]
Question: How to search cons array to return hash where either "Phone1".gsub(/\D/, '') or "Phone2".gsub(/\D/, '') matches any string within the pait_nums array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment