You have to use StringTokenizer class with delimiter "^" and then have to get first char from each word. This number can be an index in your color array for example List
EDIT:
Create stringTokenizer like this
StringTokenizer sT = new StringTokenizer(yourString, "^");
while(sT.hasMoreTokens()) {
String myColorString = sT.nextToken();
int color = myColorString.charAt(0);
String text = myColorString.substring(1, myColorString.length-1);
}
then you can get color by color variable and color your String text :).
When you will have number more than 2 chars you can use regular expression, but problem will appear when you want to have number on start of your String which you want to color :);
I think it will be better to make something like this 1;myString^2;myString2^3;myString3
and the you can use string tokenizer for each number;myString too.