我有一个格式错误的文件:
================================================
Header of file with date and time
================================================
Loaded options from XML file: 'path/to/file/some_file.xml
extendedPrintPDF started
extendedPrintPDF: Error: Unsaved documents have no full name.; line: 332
================================================
Header of file with date and time
================================================
Error opening document: path/to/file/some_file1: Error: Either the file does not exist, you do not have permission, or the file may be in use by another application; line: 190
Error opening document: path/to/file/some_file2: Error: Either the file does not exist, you do not have permission, or the file may be in use by another application; line: 190
我在用
preg_match_all('/Error: (.*)/m', $file_data, $erroenames,PREG_PATTERN_ORDER);
获取数组中的所有错误。对于第一组中的错误,它似乎工作正常。但是,以“错误打开文档”开头的第二组错误似乎显示为数组的单个元素,因此,我只有 4 个数组元素而不是 9 个。但是,当我在http上尝试相同的事情时://www.spaweditor.com/scripts/regex/index.php,所有错误都显示为数组的不同元素,我得到 9 个元素。有人可以告诉我我做错了什么吗?我尝试使用 | 并为“打开文档时出错”再创建一个正则表达式。但是,即使这样似乎也不起作用。