繼續從Getting the file name from a text file after string matching - PHP 我有格式的log.txt文件讀取錯誤和文件名:從log.txt文件
================================================
Header of entry with date and time
================================================
Loaded options from XML file: '/path/to/the/file/some_file.xml
extendedPrintPDF started
Postfix '4.4' was append from file 'some-other_file.xml' for file: /path/to/the/file/some-other_file.indd
printPDF started
PDF Export Preset: Some preset
PDF file created: '/path/to/the/file/some_filey_namex_lo_4.4.pdf'.
File filename_lo-metadata.xml removed
postprocessingDocument started
INDD file removed: /path/to/the/file/some_file1_name_lo.indd
Error opening document: /path/to/the/file/some_file_name_lo.indd: Error: Either the file does not exist, you do not have permission, or the file may be in use by another application; line: 190
================================================
Header of entry with date and time
================================================
Loaded options from XML file: '/path/to/she/file/some_options.xml
extendedPrintPDF started
extendedPrintPDF: Error: Unsaved documents have no full name.; line: 332
我想捕字「錯誤」(如果存在)的日誌條目,然後檢測錯誤消息(如「未保存的文件都沒有全名」),或者只是「錯誤打開文件」,並獲得所有和ONLY正在創建的PDF文件的名稱。
我是一個新手,真的不知道應該怎麼去這樣做。
我想我已經提供了完整的信息,這是我沒在我以前的帖子做。
更改: 我還想從/path/to/the/file/filename.something獲取'the'。 我不是在尋找一個確切的答案(儘管這將是巨大的)。但是,一些幫助或指導將不勝感激。
注: 有沒有辦法做到這一點,不許使用正則表達式(我是一個新手,也,我不是在正則表達式都好) 感謝
最好的方式來獲得良好的正則表達式是坐在一個在線正則表達式測試儀和數字像這樣的事情了:-) – phpisuber01
@Bart:疑難雜症。謝謝。 :) –