in reply to Re^2: How to capture quantified repeats?
in thread How to capture quantified repeats?

I don't see how Text::CSV is not a good answer for this question, both the sample data and the actual scenario described above (nothing in the scenario required regular expressions). Example (error handling left as an exercise):

use strict; use warnings; use Text::CSV; my $ham = "spam\tspam\tspam\t\tyam\tclam"; my $csv = Text::CSV->new({sep_char => "\t", quote_char => undef}); my $status = $csv->parse($ham); my @jam = $csv->fields(); print join("\n", '**', @jam, '**', '');