Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
让我们考虑这个 html 代码:
<html<body><p><b>Hi there</b></p><a href="a.com">click here</a></html>
我想从此 html 代码中删除 html 标记之间的内容并检索 html 结构。像这样:
<html<body><p><b></b></p><a href="a.com"></a></html>
这能满足吗?
txt.replaceAll(">[^<]*<","><")