def match regex, options = {}
      # Check if regexp has a group in it.
      #
      raise "Regexp /#{regex.source}/ needs a group in it that defines which digits belong to the NDC." unless regex.source =~ /\(/
      
      NationalSplitters::Regex.instance_for regex, options[:on_fail_take], options
    end
def match regex, options = {}
      # Check if regexp has a group in it.
      #
      raise "Regexp /#{regex.source}/ needs a group in it that defines which digits belong to the NDC." unless regex.source =~ /\(/
      
      NationalSplitters::Regex.instance_for regex, options[:on_fail_take], options
    end
If you have a number of (possibly) variable length NDCs
 that can be well expressed via regexp, use this.

 @param [Regexp] regex A Regexp describing the NDCs (First group must contain the NDC, eg. /^(0\d{2})\d+$/) contains all NDCs with 0xx...

 @return NationalSplitters::Regex A regexp-based national splitter.

 @example With several NDC matchers.
   country '52',
     match(/^(0\d{2})\d+$/)   >> split(2,2,2,2) |
     match(/^(33|55|81)\d+$/) >> split(2,2,2,2) |
     match(/^(\d{3})\d+$/)    >> split(3,2,2)