def expand(behavior = nil, values = {})
      return to_s if values.empty? or behavior == :ignore
      raise ExpandError,    "cannot expand with keys %p" % values.keys.sort if behavior == :raise
      raise ArgumentError,  "unknown behavior %p"        % behavior         if behavior != :append
      params    = values.map { |key, value| @@uri.escape(key.to_s) + "=" + @@uri.escape(value.to_s, /[^\w]/) }
      separator = @string.include?(??) ? ?& : ??
      @string + separator + params.join(?&)
    end
def expand(behavior = nil, values = {})
      return to_s if values.empty? or behavior == :ignore
      raise ExpandError,    "cannot expand with keys %p" % values.keys.sort if behavior == :raise
      raise ArgumentError,  "unknown behavior %p"        % behavior         if behavior != :append
      params    = values.map { |key, value| @@uri.escape(key.to_s) + "=" + @@uri.escape(value.to_s, /[^\w]/) }
      separator = @string.include?(??) ? ?& : ??
      @string + separator + params.join(?&)
    end
Identity patterns support expanding.

 This implementation does not use {Mustermann::Expander} internally to save memory and
 compilation time.

 @example (see Mustermann::Pattern#expand)
 @param (see Mustermann::Pattern#expand)
 @return (see Mustermann::Pattern#expand)
 @raise (see Mustermann::Pattern#expand)
 @see Mustermann::Pattern#expand
 @see Mustermann::Expander