Of course the flaw in this whole technique is if the error message actually contains a right-bracket, you won't get the whole thing. If you know this will never happen, that won't be a problem, but the original code is somewhat more robust in the face of unknown input.
| [reply] |
That seems to work, despite the fact I was under the impression that the first .* would gobble up the entire line, being greedy and all.
Also, I guess I should have said I'm attempting to avoid .* ... learning experience, I guess. but, yes, this seems like a much more elegant solution then the one I had written by far.
I'm still trying to figure out why the .* doesn't grab the entire line ... because of the second .*, I guess?
And, I'm going to see if I can find rindex in the perldocs because, frankly, I've never seen/heard of it before. :)
- Erik theAcolyte
ps. I know there are log parsers on CPAN, but I'm just mucking around ... i have a full script doing what I want and working just fine ... but I noticed how ugly my regEx was and wanted to see how to improve on it :)
| [reply] |
| [reply] [d/l] [select] |