Have this method do a hash lookup to the class that represents the snippet type:

~~~~ruby
{
  regexp: Snippet::Regexp,
  legacy: Snippet::Legacy,
  percent: Snippet::Percent,
}.fetch(type).new(pattern)
~~~~

Now you could move the code from lines 104-111 onto a base clases for a Snippet.