I have this string
String str=lookup('PRODUCT','LKP1','LKP_TAB1.ID')||('A'='B')-lookup('PRODUCT','LKP2','LKP_TAB1.ID')||'CON.ID'
This is just one example, in practical situation the lookup expression may exist any where and any number of times in the string. Also the string may have several other '(' and ')'. I need to convert the string to
=lookup('PRODUCT','LKP1','LKP_TAB1.ID',123)||('A'='B')-lookup('PRODUCT','LKP2','LKP_TAB1.ID',123)||'CON.ID'
It means I need to replace the ')' with ',123)' when it comes with lookup. But if it is not adjuscent with lookup then I dont wanna replace it.
Can this thing be done in java??