Grimy, has that changed? Just quickly trying to find info about that, and I see on regular-expressions.info/recursecapture.html it says "When Perl 5.10 [through to 5.18]'s regex engine enters recursion, all capturing groups appear as they have not participated in the match yet."
Found it :P I think "$x" isn't good enough of a non-empty contradiction for Perl
Wait, the opposite, Perl doesn't need those: (?=(?'a'[\s\S]*))(?'b'X(?=\k'a'\z)|(?<=(?=$x|(?&b)).)) works fine haha
er
I mean (?=(?'a'[\s\S]*))(?'b'X(?=\k'a'\z)|(?<=(?=(?&b)).))
Looks like Perl is doing something with "$x". Maybe some sort of optimization. Very puzzling. "x^" is fine though, so the expression can be touted for both Perl/PCRE now with that :)