【发布时间】:2011-10-18 21:32:39
【问题描述】:
我有这个 HTML 文档:
<!--SETTINGS
title: This is the title
keywords: dummy, title, longer keyword, another
description: This is the description of the page
-->
dit is de home dit is de homedit is de homedit is de homedit is de home
dit is de home
dit is de home
dit is de home
dit is de homedit is de homedit is de homedit is de home
dit is de homedit is de homedit is de home
现在,我想匹配开头的评论。我认为我的正则表达式模式如下所示:
<!--SETTINGS([\s\S])*-->
当我在 http://regexr.com?2ucae 中测试它时,一切似乎都正常运行。 当我把它放在 PHP 中时,我得到一个错误:Fout 101 (net::ERR_CONNECTION_RESET): Connection lost.
我做错了什么?
【问题讨论】:
-
XPath
//comment()将匹配 DOMDocument 中的所有 cmets。