Variable - adicionar uma variavel que recebe o valor de uma outra variavel e altera o valor via regex

The value of the received environment variable is = prd
I need to change the value to prod via regex.

I applied the following regex to the variable: ${env:regex.replaceAllString(“prd”,“prod”)}
It doesn’t change to prod, it always returns prd… if I send the environment variable with the value nprod it returns the correct value nprod as it should be.