$/ = "\n\n"; # set to grab whole paragraphs, not lines my @paras = ; my $whatever = qr/paragraph/; for (@paras) { print "$1$2$3\n" if /^(.*)($whatever)(.*)$/m; } __DATA__ This is the first paragraph And paragraph two is here Here is the third paragraph to wrap it up