code: func newRedirect(_ context.Context, next http.Handler, regex string, replacement string, permanent bool, name string) (http.Handler, error) {
  	re, err := regexp.Compile(regex)
  	if err != nil {
  		return nil, err
  	}
  
  	return &redirect{
  		regex:       re,
  		replacement: replacement,
  		permanent:   permanent,
  		errHandler:  utils.DefaultHandler,
  		next:        next,
  		name:        name,
  	}, nil
  }
docs: // New creates a Redirect middleware.