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