Given a file with the following string:
fastcgi_param WP_ENV staging;
I need an sed expression that will replace the word 'staging' with a new string:
fastcgi_param WP_ENV production;
In the first example the 3rd word is variable. It could be any lowercase string eg development, local, etc.
I tried the following:
sed 's/fastcgi_param WP_ENV [\w+]/fastcgi_param WP_ENV production/g'
but it does not pick up the work correctly. The regexp for the word does not match.
What would be the correct sed command to do this type of replacement?