my @splitted = split /(?:(?=a{2})(?<=a{2}))/, 'aaaaaaaaa'; print join " ", @splitted; output recieved :aa a a a a a aa output desired :aa aa aa aa a