ReUtil.replaceAll
通过正则查找到字符串,然后把匹配到的字符串加入到replacementTemplate中,$1表示分组1的字符串
importcn.hutool.core.util.ReUtil; publicclassTest { publicstaticvoidmain(String[] args) { Stringcontent="hello world1"; Stringdata=ReUtil.replaceAll(content, "(\\d+)", "!"); System.out.println(data); } }