local *nums; our @nums; $x =~ / \s (?: [^\s\d]* (\d+) (?{ push(@nums, $1) }) )* /x;