This is a follow-up from:
I am trying to use the 'region-match' facility to syntax-highlight stack-traces in some logfiles: these logfiles (log4j-based) look a bit like this:
YYYY-MM-DD HH:MM:ss,SSSS...INFO...Message
YYYY-MM-DD HH:MM:ss,SSSS...INFO...Message
YYYY-MM-DD HH:MM:ss,SSSS...ERROR...Message
...stack trace...
...stack trace...
...blah blah, more server-vomit...
...
YYYY-MM-DD HH:MM:ss,SSSS...INFO...Message
So far I have managed to almost do what I want with this:
:syntax region error matchgroup=string start=/^\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2},\d\{3}.* ERROR/ end=/^\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2},\d\{3}/
But the issue, is that match goes too far - it includes the next record (ie, the match includes the next YYYY-MM-DD....).
I believe from this example (an exampled about quoted text) in the VIM manual that I should be able to highlight in-between? (But I don't seem to be able to map the syntax for my example)
http://vimdoc.sourceforge.net/htmldoc/syntax.html#:syn-excludenl
So to be clear: I need to match the first YYYY-MM-DD... line (which includes 'ERROR') and then all subsequent lines up to but NOT including the next YYYY-MM-DD line.