我的 html 文档中有这个结构:
<p>
"<em>You</em> began the evening well, Charlotte," said Mrs. Bennet with civil self–command to Miss Lucas. "<em>You</em> were Mr. Bingley's first choice."
</p>
但我需要将我的“纯文本”包装在标签中,以便能够处理它:)
<p>
<text>"</text>
<em>You</em>
<text> began the evening well, Charlotte," said Mrs. Bennet with civil self–command to Miss Lucas. "</text>
<em>You</em>
<text> were Mr. Bingley's first choice."</text>
</p>
任何想法如何做到这一点?我看过 tagoup 和 jsoup 但我似乎没有办法轻松解决这个问题。也许使用一些花哨的正则表达式。
谢谢