Regulator and method for regulating the pressure of a fluid