my @r; # Results, array refs for each row record $text = fetch_that_blob(); $text =~ s/ (.+?) (?:\s*\n)+ (?: (\d+ (?:\sPSI)?) (?:\s*\n)+ ){4} /push @r, [ $1, $2, $3, $4, $5 ]/esgx;