Yes, this would depend heavily on how much optimization / transform the RE
compiler does. After all, Leif's argument would seem to work against using
a Trie, but that is in fact faster because of pattern matching
re-organization.
On Tue, Jan 15, 2019 at 11:29 AM Walt Karas wrote:
> I don't know
I don't know the details of the algorithm for generating a state
machine to match a PCRE. I was wondering if there is an optimization
so that matching an alteration of subpatterns is faster than than
matching each subpattern sequentially.
On Tue, Jan 15, 2019 at 11:21 AM Leif Hedstrom wrote:
>
>
> On Jan 15, 2019, at 10:09 AM, Walt Karas wrote:
>
> When we remap we go through the list of regexs looking for a match.
> What if we took all the regexes, removed subpattern captures, and
> created one giant pattern with alternation and capture of the regex
> for each rule, like:
>
> (regex
When we remap we go through the list of regexs looking for a match.
What if we took all the regexes, removed subpattern captures, and
created one giant pattern with alternation and capture of the regex
for each rule, like:
(regex1)|(regex2)|...|(regexN)
We could then just step through the array o