Does the LuA pathological model have an index running time?

As we all know, regular expressions implemented in a recursive manner (rather than NFA/DFA) may require exponential running time in some cases. Lua patterns are implemented through recursive matchers (they Backtracking is allowed), but they are not as functional as regular expressions (forget %b mode).

Does Lua mode require exponential running time? And there is no backtracking (any occurrence of %0, %1, %2… patterns)? If so, I will appreciate some examples.

Yes, lua mode can use exponential time. Try running:

string.find('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'a?a?a?a?a?a?a?a? a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?'
..'a?a?a?a? a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

If you keep the model simple, they can still run reasonably, so I will try Test some real examples on your own data.

As we all know, regular expressions implemented in a recursive manner (rather than NFA/DFA) may be required in some cases Exponential running time. Lua modes are implemented by recursive matchers (they allow backtracking), but they are not as functional as regular expressions (forget %b mode).

Does Lua mode require exponential operation? time? And there is no backtracking (any occurrence of %0, %1, %2… patterns)? If so, I will appreciate some examples.

Yes, lua mode can use exponential time. Try running:

< p>

string.find('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'a?a?a?a?a?a?a?a?a?a?a?a?a?a?a? a?a?a?a?a?a?a?a?a?a?a?'
..'a?a?a?a?a?a?a?a?a?a? a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

If you keep the model simple, they can still run reasonably, so I will try to test some real examples on your own data. /p>

Leave a Comment

Your email address will not be published.