<?php

$re = "/('.)\\1*/"; 
$str = "'a'a'a'a'b'c'c'a'a'd'e'e'e'e"; 
preg_match_all($re, $str, $matches);
print_r($matches[0]);