4 ms·
Yes, and even if you aren’t constructing a DFA, only being able to produce a finite number of derivatives from a given RE is still useful: As there’s only a fi
by mananaysiempre 4y ago
Yes, and even if you aren’t constructing a DFA, only being able to produce a finite number of derivatives from a given RE is still useful:
As there’s only a finite number of derivatives, their length is obviously bounded by a constant for a fixed starting RE (though that constant is still exponential in the length of that RE). This implies your non-DFA-based matcher can only take a bounded time computing the next derivative, so takes a time proportional to the length of a string to process that string (even if the constant of proportionality is exponential in the RE length).
(I’m not good at fitting all of my reasoning into a single comment today, am I?)