Searched all over to find out how to replace quoted values in Strings. (I expected this to be a common requirement!)
Considered this simple example:
String test1 = "This is a string with a \"dog\" and a \"cat\" that are unwanted.";
System.out.println(test1);
System.out.println(test1.replaceAll("\".*\"", "ZAPPED"));
produces:
This is a string with a "dog" and a "cat" that are unwanted.
This is a string with a ZAPPED that are unwanted.
But I wanted:
This is a string with a ZAPPED and a ZAPPED that are unwanted.
I expected the pattern matching to stop at the second quote (at least in replaceAll()).