use strict; use warnings; use Data::Dumper; #my @array = ; #my $text = join '', @array; undef $/; my $text = ; my @matches = $text =~ m{class="report".*?&id=1">\s*(.*?)\s*(.*?)\s*}sgx; print Dumper(\@matches); __DATA__ link to blah 1 cell2 1 some other stuff link to blah 2 cell2 2 #### $VAR1 = [ 'link to blah 1', 'cell2 1', 'link to blah 2', 'cell2 2' ];