in reply to Another question about expanding variables in text strings

You could try to not be greedy:

s/\$(.*?\])/${$1}/g

--telesto