From: Stefano Crocco Date: 2008-03-03T18:41:08+09:00 Subject: Re: Patterns for error messages Alle Monday 03 March 2008, Victor 'Zverok' Shepelev ha scritto: > OK, but this regexp works for the second case ONLY (unfortunately, I have > only one "output pattern" setting, so, I am trying to invent the universal > one). It should work for all the first three cases (at least, it does in ruby, which I'm using to test it). > > >Regarding the last case, I think (but I may be wrong) that the third and > >last > >one are a single message, split in two lines for some reason. You should > >try > >to understand why this happens and act consequently. If you post the full > >error messages, maybe with a piece of code which generates them, I can try > >to > >help you more. > > Yes, it is like call stack: first line has something like case1-case3, other > lines has something like case4. > > For ex: > > D:/!work/home/!stuff/ruby-tricks/test.rb:1:in `require': ./tricks.rb:31: > syntax error, unexpected ']', expecting $end (SyntaxError) > p 1,2,3].inject(0){|sum, n| sum + n} > ^ from D:/!work/home/!stuff/ruby-tricks/test.rb:1 > This should take care of all the four patterns: /^(?:.*:\d+:in\s+`require':\s+|\s+\^\s+from\s+)?(.*)(?=:\d+)/ Stefano