if ($string =~ /$regex/x) { print join(" ", map $$_, 1..$k), "\n"; }