Grab this 'test1' (repeat/new) many lines ... .. .. Grab this 'test2' (repeat/new) many lines ... .. .. Grab this 'test3' (repeat/new) #### while ($current_line = <$file_pointer>) { if ($current_line =~ /Grab this\s+(.*)/) { $GRAB = $1; push (@grab_array, $GRAB); print "$GRAB"; } }