my $ham = "spam\tspam\tspam\tyam\tclam"; my $word = qr{[^\t]+}; my $sep = qr{\t}; my $capture = qr{($word)}; my (@jam ) = ($ham =~ m{\A # enforce beginning of string $word $sep # skip first word and separator $word $sep # and the second $capture $sep # capture next two words $capture $sep # skip the separators $word # skip a word \z # and then it's the end of the string }xms); print join("\n", '**', @jam, '**', ''); #### my @jam = ( spit "\t", $ham )[2,3];