Hi,
Can you explain, why capturing atomic groups with capturing brackets
inside can't produce tail recursion in cases when '(?:' can do this?
because PCRE has to prepare for the worst case scenario. Your input string does
not match to the capturing bracket, so the capturing bracket does not
Here is the answer to your question: in the second case, you see the
effect of an optimization called tail recursion.
Suggestion: if it is possible, don't use capturing brackets inside
atomic blocks.
Thanks a lot, Zoltan!
Can you explain, why capturing atomic groups with capturing
Good day!
Here is two pcretest.exe listings:
PCRE version 8.34-RC 2013-06-14
/(?(1)|2|.)*?(3|4)/
\Mabcdefghijklmnopqrstuvwxyz
Minimum match() limit = 217
Minimum match() recursion limit = 55
No match
PCRE version 8.34-RC 2013-06-14
/(?:(1)|2|.)*?(3|4)/
\Mabcdefghijklmnopqrstuvwxyz
Minimum
Hi Naden,
I like that you always have some interesting questions :) It is great to talk
about the internals and optimizations of PCRE.
Here is the answer to your question: in the second case, you see the effect of
an optimization called tail recursion. You can even see that in the first
case,