Add captured pattern as context variable