if ($filecontents =~ /\*\sdisks/) { # delete everything up to the first occurrence # of "* disks" $filecontents =~ s/^.*?\*\sdisks//; print "$filecontents\n\n"; }