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