如何使用html解析器或正则表达式删除第一个<p> ....... [内容] </p> [仅限开始和结束标记]

时间:2012-06-12 09:55:33

标签: regex html-parsing

String  s  = "<p>test with only p tag </p>";

输出应为test with only p tag

String  t  = "<p>test with only p tag </p><p></p>";

输出应为test with only p tag <p></p>

1 个答案:

答案 0 :(得分:0)

(?<=<p>).+(?=</p>)

应该有效