I have a string in Java like this:
REF([123],[456],[78]),REF([789],[456],[12]),{111},REF([8069],[8098],[56])
I need to remove all the third occurring digits inside all the REFs. Meaning I need to remove [78], [12] and [56] (starting from the second comma till before the closing brackets) from the string so that I get this following output:
REF([123],[456]),REF([789],[456]),{111},REF([8069],[8098])
What should my regex be?