preg_match_all('/[\s]{1}(AA|BB|CC)+[\s]{1}/',' AA BB ',$matches);
sonuç AA, ama AA ve BB gerekir.
AA
BB