my $qr = qr|whatever(somecapture_re)whatever|; my ($captured) = m/$qr/; # does not work