字符串网址:<a href='https://sample.com'>Example:</a>
我想保留文本Example
: 如何使用替换全部来删除/替换为" "?
特别是对于您的情况:
String url = "<a href='https://sample.com'>Example:</a>";
String text = url.replaceAll("<a.*>\b", "").replaceAll("</a>", ""));