My comments in that thread were on an entirely different matter (handling backtracking through (?{}), which isn't an issue in the code here), but blokhead mentioned the issue with lexicals in that thread.
Comment on Re^4: Determining which pattern matched