So, I'm trying to catch 3 letter word from a text file. I've created a RegEx, but it return an EMPTY array. And I'm not able to figure out why! Here's a part of the text file.
================================================
Header of File with time and date
================================================
Loaded options from XML file: '/Thisis/some/Users/sumuser/Desktop/SM_Folder/ESQ/Virtual_Proof_ESQ/processing/ID2PDF_options.xml
extendedPrintPDF started
Postfix '3.0' was append from file 'ESQ030112ELAM_lo-metadata.xml' for file: '/Thisis/some/Users/sumuser/Desktop/SM_Folder/ESQ/Virtual_Proof_ESQ/processing/someFile.indd
printPDF started
PDF Export Preset: Some preset
PDF file created: ''/Thisis/some/Users/sumuser/Desktop/SM_Folder/ESQ/Virtual_Proof_ESQ/processing/someFile.pdf'.
File someFileName.xml removed
postprocessingDocument started
INDD file removed: '/Thisis/some/Users/sumuser/Desktop/SM_Folder/ESQ/Virtual_Proof_ESQ/processing/someFile.indd
Here's the RegEx I have:
/^Loaded options from XML file: '\/.*\/SM_Folder\/([a-zA-Z]{3})\/[a-zA-Z]+_Proof_\1\/processing\/ID2PDF_options.xml$/im
If I remove \
in front of \/([a-zA-Z]{3})
, I get an Unknown modifier:(
error.
Can someone please tell me what I need to do to grab the "ESQ" from the first line of the record? The 3 letter word would be different in other records and so, I can't really design my RegEx to catch only ESQ. It might be ABC or XYZ for example. But, it would remain as a 3 letter word. Any useful inputs would be appreciated.
Also, this post didnt help much either: PHP Regex returning array with values empty
Note:
options.xml
doesn't end with '
because it is not supposed to!