Suppose I'm dealing with strings of symbols $S = AAa$ where $A = aaa$ and that in order to describe the permutations $AaA, aAA$, I'm indexing the symbols as they occur (left-to-right works): $S_1 = A_2 A_3 a_4$. If I now consider all permutations of indexed symbols on the right of "$=$" (essentially all permutations of $\{2,3,4\}$, then there are many uninteresting ones such as $A_3 A_2a_4$.
Can these uninteresting permutations be filtered out while still retaining a group structure? Or is there another way to view the symmtries: $AAa$, $AaA$, $aAA$? The method must apply to longer strings as well.