I have strings in the format below, which need to be transformed to:
4ABC3D -> AAAABCDDD
ABCD2F -> ABCDFF
Basically the number shows how many times the next character should be repeated. I'm using C# and regex.Replace() method, but I'm not sure how to repeat the character captured by Group 1 a number of times, captured in Group 2:
string inputString = "4ABC3D";
Regex regex = new Regex("([0-9]+)([A-Z])");
inputString = regex.Replace(inputString, "$1{$2}");
//returns 4{A}BC3{D}
Any help is appreciated :)