On Mon, Jan 28, 2013 at 1:40 PM, Joerg Sonnenberger <[email protected] > wrote:
> > You don't understand me. Anchoring helps, if you can use it to avoid > initial wild cards or limit the length of backtracking. It doesn't help > to avoid the exponential edge cases with .*foo patterns though. > I think another point is that the Lua regexp does not do anchoring (or at least I didn't see it - did I miss something?) FWIW, the regexp.c code already present in Fossil does not need anchoring to avoid exponential blowup, since it uses an NFA. However, it does use anchoring as a performance optimization, to avoid running the NFA over every byte of input text. The NFA is linear in the size of input, but the constant of proportionality is large relative to memcmp() so we like to use memcmp()-based anchoring to avoid having the NFA look at every single byte of input. -- D. Richard Hipp [email protected]
_______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

