请问这个用正则如何匹配?
目的是匹配网页源代码中的href,大概有三种类型
类型一:
$str=
<a href="http://bbs.111.com/thread-11.html" onclick="atarget(this)" class="xst">一一一一(seo)</a>
类型二:
<th class="common">
<em>[<a href="http://www.444.com/forum.php?">引蜘蛛</a>]</em><a href="http://www.444.com/thread-263.html" onclick="atarget(this)" class="xst">二二二二</a>
类型三:
</th><th class="common">
<a href="http://www.555.com/thread-161.html" style="color: #EC1282" class="xst" target="_blank">三三三</a>
</th><th class="aa">
<a href="http://www.555.com/thread-161.html" style="color: #EC1282" class="xst" target="_blank">三三三</a>
html;
preg_match_all('/(?:</th><th class="new|common">).+<a href="(%5B%5E" print_r class="clear"></a>
</th>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号