String str="abc{K}JK#,$o"
str = str.replaceAll("{K}", "ZCX");//会报错无法匹配

使用Hutool的StrUtil工具类可以解决这个问题。

str = StrUtil.replace(str, "{K}", "sdf");