I have a string with the following format:
String str = "someString(anotherString)(lastString)";
I wanted to replace the lastString inside the last brackets, i.e new String should be
newStr = "someString(anotherString)(modified)";
I am using regex with "\\(([^\\}]+)\\)$" pattern.
But I am unable to change only the last content inside brackets. The above regex gives me the output:
"someString(modified)";
I just want to replace the content of the last brackets, any characters can appear infront of last bracket.
ANy help is appreciated.