Help for this page
my ($start,$middle,$end) = $string =~ /^(.*?)(($pattern)+)(.*?)$/g;
my ($start,$middle,undef,$end) = $string =~ ...