您的原始表达式很好,我们可能只想添加一个m标志:
\('(.+?)'\)
测试
$re = '/\(\'(.+?)\'\)/m';
$str = ' sadsssss_(\'test1\');
sdfsd _(\'test2\');
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
foreach ($matches as $key => $value) {
echo $value[1] . "\n";
}
当年话下
相关分类