code: func New(ctx context.Context, next http.Handler, config config.ReplacePathRegex, name string) (http.Handler, error) {
  	middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")
  
  	exp, err := regexp.Compile(strings.TrimSpace(config.Regex))
  	if err != nil {
  		return nil, fmt.Errorf("error compiling regular expression %s: %s", config.Regex, err)
  	}
  
  	return &replacePathRegex{
  		regexp:      exp,
  		replacement: strings.TrimSpace(config.Replacement),
  		next:        next,
  		name:        name,
  	}, nil
  }
docs: // New creates a new replace path regex middleware.