On Mon, 26 Sep 2011, Father Chrysostomos via RT wrote: > *at the current starting position* > > (*THEN) acts like (*COMMIT) in the example given above. Aha. Since we are quoting "man perlre", here's another bit of confusion: "(?PARNO)" "(?-PARNO)" "(?+PARNO)" "(?R)" "(?0)" Similar to "(??{ code })" except it does not involve compiling any code, instead it treats the contents of a capture buffer as an independent pattern that must match at the current position. Consider this pattern (ignore white space): ^.*? (?1) c (?(DEFINE) (a(*THEN)b) ) When I read "an independent pattern", it suggests to me that the effect of (*THEN) is confined to that independent pattern. However, experiment with Perl shows that I am wrong here as well. The pattern as it stands does not match "aabc", but if |(*F) is added after b, it does. As it happens, PCRE processes recursions/subroutines differently to Perl, or perhaps I should say that the other way round, since PCRE had them first. :-) So another difference probably doesn't matter much. However, I'm still thinking about this whole issue with regard to PCRE implementation. It tries to resolve where (*THEN) should back up to at compile time, but looking at the example above, it seems to me that it can only be done dynamically, at run time. Regards, Philip -- Philip HazelThread Previous | Thread Next