function parseStr(str){
let execResult = /\((\w+)\)<(\d+)>/g.exec(str);
while(execResult) {
str = str.replace(execResult[0], execResult[1].repeat(execResult[2]));
execResult = /\((\w+)\)<(\d+)>/g.exec(str);
}
return str;
}
console.log(parseStr('a(b)<10>c')); // abbbbbbbbbbc
console.log(parseStr('a(b)<2>(c)<3>')); // abbccc
console.log(parseStr('a(b(c)<3>de)<2>f')); // abcccdebcccdef
