Finding common structure in strings I don't even know the right words to describe my problem, so I'll start with an example:

"aabaa", "ccrcc", "ffaff" are equivalent to some extent, because they all have the same length and follow the same formula: twice one letter, once another letter and finally twice the first letter again.

As I said, I lack even the vocabulary to describe this commonality of structure, so the first part of my question is: what is this kind of structure called and how is it studied?

The second part of my question is: do you know of an algorithm to transform a string into a representation of its structure? Or maybe more simply, an algorithm that would assess if two strings share the same structure?
What you're describing seems to be isomorphisms between strings. (Note that there happens to be a more complicated notion that is also called 'string isomorphism', but that isn't what we're talking about here.)

You can 'describe the structure' of these strings as follows: replace each character with the number of different characters excluding itself before it in the original string. If you do this for the three strings you mentioned, you get the string '00100' in all three cases. 

This also gives an algorithm to test whether two strings are isomorphic: apply the above transformation on both strings and test whether the results are equal.