code: func interpolationFuncReplace() ast.Function {
  	return ast.Function{
  		ArgTypes:   []ast.Type{ast.TypeString, ast.TypeString, ast.TypeString},
  		ReturnType: ast.TypeString,
  		Callback: func(args []interface{}) (interface{}, error) {
  			s := args[0].(string)
  			search := args[1].(string)
  			replace := args[2].(string)
  
  			// We search/replace using a regexp if the string is surrounded
  			// in forward slashes.
  			if len(search) > 1 && search[0] == '/' && search[len(search)-1] == '/' {
  				re, err := regexp.Compile(search[1 : len(search)-1])
  				if err != nil {
  					return nil, err
  				}
  
  				return re.ReplaceAllString(s, replace), nil
  			}
  
  			return strings.Replace(s, search, replace, -1), nil
  		},
  	}
  }
docs: // interpolationFuncReplace implements the "replace" function that does
  // string replacement.