I have a file that has errors in the form:
================================================
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
I am using
preg_match_all('/Error: (.*)/m', $file_data, $erroenames,PREG_PATTERN_ORDER);
to get all the errors in an array. It seems to work fine for the errors in the first set. But, the errors in second set that start with 'Error Opening document' seem to display as a SINGLE element of the array and so, I have just 4 elements of the array instead of 9. However, when I try the same thing on http://www.spaweditor.com/scripts/regex/index.php, all errors display as different elements of the array and I get 9 elements. Can some one tell me what I am doing wrong? I tried using | and creating one more RegEx for "Error opening document". But, even that doesnt seem to work.
for example). – periklis Dec 27 '12 at 22:38