html链接是:
<a title="Next page of results" class="sprBtnSRP1 enabled" href="http://www.link.com/page.html?thisisthelink&_pgn=2&_al=25&at=t_Stack Overflow中文网
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<a title="Next page of results" class="sprBtnSRP1 enabled" href="http://www.link.com/page.html?thisisthelink&_pgn=2&_al=25&at=t 问问题
试试这个模式:
$urlpattern1 = '/<a\s+.*?href=".*?_pgn=(.*?)".*?>/i';
编辑 :
如果您只想要那个链接,那么您可以使用标题(或其他参数)作为提示,试试这个模式:
$urlpattern1 = '/<a\s+.*?title="Next page of results"\s+.*?href=".*?\_pgn=(.*?)".*?>/i';