Pattern.compile(regex).matcher(this).replaceAll(replacement)
//思想:find匹配项,如果找到,就替换,再找,do-while循环找。(如同链表查询)
public String replaceAll(String replacement) {
reset();
boolean result = find();
if (result) {
StringBuffer sb = new StringBuffer();
do {
appendReplacement(sb, replacement);
result = find();
} while (result);
appendTail(sb);
return sb.toString();
}
return text.toString();
}