Escapando em groovy

Eu preciso de ajuda para escapar em groovy

Eu tenho uma string no arquivo de texto como este# $ commonTomcat620.max_threads $ # Esses valores eu tenho que substituir em runTime.

Eu usei o seguinte código:

    def str = "#\$commonTomcat620.max_threads\$#"
    fileContents = fileContents.replaceAll("${str}","100");

Essa str é printin os valores como # $ commonTomcat620.max_threads $ #. mas não substituindo no arquivo. Eu tentei com # # $. está funcionando.

Obrigado.

questionAnswers(1)

yourAnswerToTheQuestion