Try this. Non regexp method though.
1) Take string (AABBCCDDEE) and char to replace (A)
2) Count instances of char to replace (A)
3) Create target string all chars not char to replace in string ie target string = "BBCCDDEE"
4) Append 'count' number of char to replace (ie As) at the end
Should be simple enough