do{ if ($whole =~ /^(.*?)^(\*{5,}..?^\*SRC)/mscg) { print "\n=======\n".$1."\n=======\n".$2;} } while($2);