Yes yes, regex has got me down at the moment. Let me jump right to what is going on.
This is the line I am looking for:
[15:20:21] Completed 14950 out of 20000000 steps (100)
This is the regex that works...just a note: (100) is really what I am looking for in this line but everything up to it makes the line unique. The (100) could be (25) or (57), etc at any point....I want to match (100) specifically. The follow regex matches where any of the lines could have (any number here)...:
preg_match('/^\[([0-9]{2}:[0-9]{2}:[0-9]{2})\]\s*(?:Completed)\s*([0-9])+\s*(?:out of)\s*([0-9])+\s*(?:steps)\s*(.*)$/', $line, $matches)
To find the line that has (100) I have tried this:
preg_match('/^\[([0-9]{2}:[0-9]{2}:[0-9]{2})\]\s*(?:Completed)\s*([0-9])+\s*(?:out of)\s*([0-9])+\s*(?:steps)\s*\((100)\)$/', $line, $matches)
and even:
preg_match('/^\[([0-9]{2}:[0-9]{2}:[0-9]{2})\]\s*(?:Completed)\s*([0-9])+\s*(?:out of)\s*([0-9])+\s*(?:steps)\s*(\([0-1]{3}\))$/', $line, $matches)
So the part of the regex that really has me hung is the (100)...its driving me crazy!