String-Substitution-Problem To clarify the problem, here is a sample input: INPUT: '(ab(c){2}d){2}(ab){2}' OUTPUT: 'abccdabccdabab'