我有一段 html 代码,如下所示:
<td width="24%"><b>Something</b></td>
<td width="1%"></td>
<td width="46%" align="center">
<p><b>
needed
value</b></p>
</td>
<td width="28%" align="center">
</td>
</tr>
什么是一个好的正则表达式模式来提取单词之后的第一个文本节点(不是标签,而是里面的文本)Something
我的意思是我想提取
needed
value
仅此而已。
我无法在 php 中找出有效的正则表达式模式。
编辑: 我不是在解析整个 html 文档,而是解析其中的几行,所以我想要的只是使用 Regex 而不是 HTML 解析器。