java 字符串替換 替換[]中間內容

a = a.replaceAll("\\[(.*?)\\]", "[xx]")

也能夠是: a = a.replaceAll(「(?<=\\[)(.*?)(?=\\])」, "xx");

相關文章
相關標籤/搜索