preg_match_all():编译失败:在偏移量203处没有可重复的runescape


preg_match_all(): Compilation failed: nothing to repeat at offset 203 runescape

有人能告诉我为什么这不起作用吗?

我收到错误"preg_match_all():编译失败:偏移量203处没有可重复的内容"

$html = file_get_contents('http://services.runescape.com/m=itemdb_rs/results.ws?query='.urlencode($term).'&price='.$pricerange.'&members='.$members);
$html = str_replace(array("'r","'n"), "", $html);
$regexp = '#<tr data-item-id="(.*?)"><td class="(.*?)"><img src="(.*?)" alt="(.*?)"><a href="(.*?)">(.*?)</a></td><td><img src="(.*?)" alt="(.*?)" title="(.*?)"></td><td class="(.*?)">(.*?)</td><td class="(.*?)">(.?*)</td></tr>#';
preg_match_all($regexp, $html, $matches);
print_r($matches);

将在file_get_contents 中使用的示例url

http://services.runescape.com/m=itemdb_rs/results.ws?query=gold%20bar&price=all&members=no

谢谢:)

我建议您的错误就在这里:

<td class="(.*?)">(.?*)</td></tr>#

替换为

<td class="(.*?)">(.*?)</td></tr>#