Subject: | Make match_max() not truncate $before data. |
I would like match_max() to have a different effect to max_accum().
Ideally, match_max() should specify the maximum number of chars to
pattern match against at the end of the accumulator, without truncating
the accumulator itself. So if I'm expecting a large amount of output
(which I want), and I know that my pattern is only going to occur in the
last 20 chars of data, then I should only be matching the last 20 chars.
Currently, if I want to receive all the data, I have to repeatedly match
the whole lot!
AN alternative approach would be to add a 'match_last_lines($n)'
function which specifies that only the last $n lines of data are looked
at for pattern matches. The default would be 1, which is what you would
want 99% of the time, but set to 0 for current behaviour.