I am trying to replace a sentence in .config file using powershell.
${c:Web.config} = ${c:Web.config} -replace
\'$BASE_PATH
$\\
This is about how to escape regexes. Every special character (special with regards to regular expressions) such as $
should be escaped with \
'$A$B()[].?etc' -replace '\$|\(|\)|\[|\]|\.|\?','x'
'$BASE_PATH$\Test\bin$Test_TYPE$\WebTest.dll' -replace '\$BASE_PATH\$\\Test\\bin\$Test_TYPE\$\\WebTest.dll','something'
The backtick would be used when the regex would be like this:
'$A$B' -replace "\`$",'x'