Create an regexp (Regular expression) from an array of Strings
Create a DNF regular expression from an array of strings even if they have special characters.
Regexp.new(array.collect{|string| Regexp.escape(string)}.join("|"))
DZone Snippets > eddiewould > string
12388 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Regexp.new(array.collect{|string| Regexp.escape(string)}.join("|"))