【发布时间】:2010-05-22 13:42:47
【问题描述】:
我正在尝试从http://www.auctionarms.com/search/displayitem.cfm?itemnum=9736364&oh=216543 中提取“Florida (FL)”。 我的代码是
//获取位置 $pattern = "/(状态):(.*)/"; preg_match_all($pattern, $htmlContent, $matches); print_r($matches); 知道为什么不工作吗?【问题讨论】:
-
这似乎是 SO 的一贯口号:尽可能避免使用正则表达式解析 html。它不是完成这项工作的工具。
标签: php regex preg-match