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.
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>