我试图在一个使用preg_match的网站上获取这个描述,只是有问题:
这是我想要得到的东西。就在<b>Game Description:</b><br />和<b>Tool v3.1 Info:之后的文本
<b>Game Description:</b><br />
Steel Diver is a new action-packed submarine combat game from Nintendo that<br />
immerses players in the 3D action with unique game controls and lush 3D<br />
environments. The player can choose from three different submarines, each<br />
with touch-screen control panels that players will have to master to guide<br />
them through treacherous undersea caverns while engaging enemy submarines,<br />
dodging depth charges and battling massive sea creatures. Steel Diver also<br />
takes advantage of the built-in gyroscope of the Nintendo 3DS system. The<br />
combination of 3D game play and one-of-a-kind controls makes for an immersive<br />
combination that must be experienced to be believed.<br />
<br />
<b>Tool v3.1 Info:这里是我尝试过的:
$pattern1 = '#<b>Game Description:</b><br />\s*(.*?)\s*<b>Tool v3.1 Info:#';
preg_match($pattern1,$downloadPage,$description);
print_r($description);$downloadPage只是用curl打开网址,我得到了一些其他的数据,只是需要帮助这个部分。
谢谢
发布于 2013-12-17 19:18:08
您需要 modifier在多行上进行匹配:
$pattern1 = '#<b>Game Description:</b><br />\s*(.*?)\s*<b>Tool v3.1 Info:#s';https://stackoverflow.com/questions/20642658
复制相似问题