0

让我们考虑这个 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>
4

1 回答 1

2

这能满足吗?

txt.replaceAll(">[^<]*<","><")
于 2013-09-29T04:28:41.240 回答