Help with regular expression

There is this line:

$test = '<w:t>${</w:t></w:r>nzk</w:t></w:r><w:prooferr w:type="spellEnd">}</w:t>';

You need to replace this line with any word, I try this:

$tr  = preg_replace("/\$\{.*nzk.*\}/", $replace, $test);

Nothing works, what’s wrong with me?


Answer 1, authority 100%

$tr = preg_replace('/\${.*nzk.*}/', $replace, $test);

Answer 2, authority 100%

.*   ->   .*?
$ perl 
my $test = '<w:t>${</w:t></w:r>nzk</w:t></w:r><w:prooferr w:type="spellEnd">}</w:t>';
print $test, "\n";
$test =~ s|\$\{.*?nzk.*?\}|bla-bla-bla|;
print $test, "\n";
<w:t>${</w:t></w:r>nzk</w:t></w:r><w:prooferr w:type="spellEnd">}</w:t>
<w:t>bla-bla-bla</w:t>