Regexp.optimized_union(word_list, regexp_options) generates optimized regexp for matching union of word list
luikore
WTFPL