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

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^2: How to capture quantified repeats?

Replies are listed 'Best First'.
Re^3: How to capture quantified repeats?
by james2vegas (Chaplain) on Sep 23, 2010 at 15:33 UTC
    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, '**', '');