【发布时间】:2015-04-29 13:41:19
【问题描述】:
这里是示例 html
<div>
<span class="target"> Remove parent span class only and save this text </span>
</div>
这里我想要上面的 html 如下仅使用正则表达式函数
<div>
Remove parent span class only and save this text
</div>
我试过这个:
$html = preg_replace('#<h3 class="target>(.*?)</h3>#', '', $html);
但是没有用。
【问题讨论】:
-
你试过了吗?
-
$html = preg_replace('#^ 然后将add 加入您的问题并展示您的努力/工作!感谢您的快速回复,但没有成功
标签: php regex html-parsing