I'm trying to find all occurrences of a set of strings and replace what is in between them within a new value. I have tried all of the examples for Java/ regex I have found on this site and none have worked. A sample of the string would look like this:
"TestValue 1 VARCHAR(10), TestValue2 FLOAT(126), TestValue3 FLOAT(135)"
I would want to find and replace all the values between "FLOAT(" and ")" with 53 so that the above string would be replaced with:
"TestValue 1 VARCHAR(10), TestValue2 FLOAT(53), TestValue3 FLOAT(53)"
How can I do this with a String.replaceAll ?
I have tried replaceAll("FLOAT(.*?)", "53") and it just replaces the FLOAT so the string looks like:
"TestValue 1 VARCHAR(10), TestValue2 53(126), TestValue3 53(135)"
replaceAll("T\(\\d+\)", "T(53)");?