Maybe Regexp::Assemble or Regexp::Trie is what you're looking for?
In reply to Re: Matching a long list of phrases by Fletch in thread Matching a long list of phrases by Hagbone