#!/usr/bin/perl # http://perlmonks.org/?node_id=1213573 use strict; use warnings; #print join('', ) =~ /^start.*\n(?:\+.*\n)*/gm; # my preference :) while() { /^start/ .. /^(?!start|\+)/ and /^(start|\+)/ and print; } __DATA__ ignore this line :) start text + 123 + 456 + 789 some other text not starting with + another test case start text + foo + bar start text + one + two + three also ignore this line