我想在第一个换行处分割字符串,而不是第一个空行。
'
例如,如果我有:
$str = '2099测试\n你确定你要继续吗\n这里还有一些其他的字符串...';
'
/^(.*?)\r?\n\r?\n(.*)/s'
(第一个空行)例如,如果我有:
$str = '2099测试\n你确定你要继续吗\n这里还有一些其他的字符串...';
match[1] = '2099 test'
match[2] = 'Are you sure you want to continue\n some other string here...'