如何替换<a href='www.example.com'>Example:</a>?

How to replace <a href='www.example.com'>Example:</a>?

字符串 url : <a href='https://sample.com'>Example:</a>

我想保留文本 Example: 如何使用 replaceAll 做 remove/replace with " "?

特别适合您的情况:

String url = "<a href='https://sample.com'>Example:</a>";
String text = url.replaceAll("<a.*>\b", "").replaceAll("</a>", ""));