Quand tu fais un replaceAll(), tu peux faire reference aux groupes avec $ suivi d'un nombre. Par exemple si tu as la regex ([ab])c et que tu fais un replaceAll() sur la chaine "bc", alors $1 == "b". Bref, echappe ton signe $ par un \\.
Extrait de la doc de String.replaceAll() :
Citation:
Note that backslashes (\) and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string; see Matcher.replaceAll.
Bref, comme toujours il faut lire la doc :)