in reply to Growing strings in search

By "growing", do you mean you have variables that contain the strings and their content gets longer over time? Or do you need to read the strings from outside (a file, socket)?

The answer also depends on the regex. For a simple regex, just starting where you left off might be enough (e.g. qr/X/), but even for a bit more complex regex qr/abc/, you can't just continue with the newly added characters, as the original string might have end in "ab" and the new character might be "c" that completes the match. For even more complex regexes like qr/a.*b/ you might need to return unknown number of characters to the left (i.e. to the last "a").

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Growing strings in search
by b4swine (Pilgrim) on Apr 15, 2020 at 15:47 UTC

    The strings are growing because data is coming in from the outside.

    The regexes are so complicated that they are software generated.

    The only other possibility seems to be to try to understand the regex and see if it can be expressed as something simpler, but that sounds too horrible to contemplate.