在给定的页面上有一堆元素:
<div class="some class"> <-- here is anything, other divs, even other divs with
the same class, but I need to match right on closing tag for this particular
opening tag --></div>
最佳答案
不要使用正则表达式来解析 HTML。使用 DOMDocument相反,让你自己省去所有的麻烦。
Stack Overflow 上的相关阅读:
关于php - 如何匹配整个 html 元素,无论里面有什么,就像浏览器一样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3456657/