我有一个字符串(来自文件):
ILX (New for 2013!)
Overview: The least expensive route to Honda's premium-label goodness
Drivetrain: Two four-cylinder engines to choose from as well as a gas-electric hybrid; front-wheel-drive only.
我如何得到字符串:
$writeup = file_get_contents($car_files_path . $manufacture . '/Stories/'.$story);
我想匹配概述行(Overview: The least expensive route to Honda's premium-label goodness)
。实现这一目标的最佳方法是什么。
我尝试了 .*\n,但这将匹配所有内容,然后是一个新行。有没有办法让正则表达式不贪婪?
我试过了:
preg_match('/^Overview:\s.*$/im', $writeup, $overall_matches)
我没有得到任何匹配