PHP:preg_match_all在匹配换行符时导致403

PHP:preg_match_all在匹配换行符时导致403,php,codeigniter,xampp,preg-match-all,http-status-code-403,Php,Codeigniter,Xampp,Preg Match All,Http Status Code 403,我只是遇到了一个奇怪的问题。目前我正在使用XAMPP和codeigniter框架 我需要匹配短代码,我的正则表达式是: \[(background)=?(.*?)\](.+?)\[/\1\] 但如果标签之间有新行,则与内容不匹配,因此我将其更改为: \[(background)=?(.*?)\]((.|\n)*)\[/\1\] 更改后,站点给我403错误。如果我把它换回来,它就行了 全部代码: while (preg_match_all('`\[(background)=?(.*?)\]((

我只是遇到了一个奇怪的问题。目前我正在使用XAMPP和codeigniter框架

我需要匹配短代码,我的正则表达式是:

\[(background)=?(.*?)\](.+?)\[/\1\]
但如果标签之间有新行,则与内容不匹配,因此我将其更改为:

\[(background)=?(.*?)\]((.|\n)*)\[/\1\]
更改后,站点给我403错误。如果我把它换回来,它就行了

全部代码:

while (preg_match_all('`\[(background)=?(.*?)\]((.|\n)*)\[/\1\]`', $string, $matches)) foreach ($matches[0] as $key => $match) {
    list($tag, $param, $innertext) = array($matches[1][$key], $matches[2][$key], $matches[3][$key]);
    switch ($tag) {
        ...
    }
    $string = str_replace($match, $replacement, $string);
}
这是错误日志给我的信息:

[Tue Jan 06 03:12:56.101114 2015] [ssl:warn] [pid 10580:tid 596] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue Jan 06 03:12:56.145116 2015] [mpm_winnt:notice] [pid 10580:tid 596] AH00354: Child: Starting 150 worker threads.

有人遇到过类似的问题并设法解决了吗?

该错误与preg_match_all()无关。在我更改正则表达式之前,它就可以工作了。我已经测试了其他几个应该匹配换行符的代码,但到目前为止结果都是一样的?我想是吧。问题在于您的安全证书。如果您可以使用http而不是https,那么问题就会迎刃而解。或者在examle.com服务器上生成一个证书并将其安装到运行PHP的本地计算机上。我不知道为什么apache错误日志会给我example.com SSL错误。Example.com与我的网站没有任何关系。代码用于函数内部,该函数应替换短代码(如wordpress中使用的)$字符串刚刚从数据库传递给函数及其内容。哦,我以为您想隐藏实际站点的标识,并编辑错误以反映example.com而不是实际站点。在代码或include中的某个地方有一个指向的链接。使用文本搜索工具(例如记事本++在文件中查找搜索功能)在与应用程序相关的所有文件中查找“example.com”。