in reply to revisit regexp reentrancy

Sorry, did it too quick, and didn't copy and paste the code for part 3, but I cannot update the original post... here comes it:
use threads; use strict; use warnings; $| ++; open(STDERR, ">", "error.txt"); sub parser { my $str = shift; $str =~ m/^\[(\d*),(.*?)\]$/; print "1 = $1\n2 = $2\n"; my $tmp = $2; if ($2 ne "[]") { my $t = threads->create("parser",$2); $t->join() } } my $str = "[0,[1,[2,[3,[4,[5,[6,[7,[8,[9,[]]]]]]]]]]]"; parser $str;