Negative look patterns that are tested on each character seem like a bad idea to me, and what you're trying to do is not difficult. You want to match (1) the rest of the line, and then (2) any number of the following (3) lines starting with something other than L \ d (small error, see below): (another edit: these are regular expressions ; if you want to write them as string literals, you need to change \ to \\ .)
.*\n(?:(?:[^L]|L\D).*\n)* | | | +-1 | +---------------3 +---------------------2
In extreme text mode . should not match \ n, but you can always replace two . in this expression with [^\n]
Edited to add: I understand that this may not work if there is an empty line before the end of the log entry, but this should cover this case; I have changed . on [^\n] for extra precision:
[^\n]*\n(?:(?:(?:[^L\n]|L\D)[^\n]*)?\n)*
rici
source share