use strict; my $arc = 'ARCSERVE.NLM'; my $slurped = do {local $/; }; #my ($temp) = $slurped =~ /^($arc.*)\n\n/sm; my ($temp) = $slurped =~ /($arc.*?\n)\n\n/s; print $temp; __DATA__ not this one or this one asdffARCSERVE.NLM or even this one ---------------- ARCSERVE.NLM sign here and here and here and here and here ---------------- but not here blah blah blah blah blah blah