I try to use Matcher.quoteReplacement,but I find it can escape $ but do not escape |.So I try to use the other method StringEscapeUt
Matcher.quoteReplacement
$
|
StringEscapeUt