Außerdem willst du ? statt * schreiben
?
+
Und mitmeinst duCode:?
?Code:+
...
String newtext = oldtext.replaceAll("\\}\\{\\{", ",");
newtext = newtext.replaceAll("\\}\\}\\{", "\\}\\,\\{");
newtext = newtext.replaceAll("\\}\\,(\\r\\n)+\\]", "\\}\\]");
newtext = "["+newtext;
...
\r\n
\n
String oldtext = "\"type\": \"bin\"\r\n" +
"}\r\n" +
"]\r\n" +
"},\r\n" +
"\r\n" +
"]\r\n" +
"},{\"property\": {";
String newtext = oldtext.replaceAll("\\}\\{\\{", ",");
newtext = newtext.replaceAll("\\}\\}\\{", "\\}\\,\\{");
newtext = newtext.replaceAll("\\}\\,(\\r\\n)+\\]", "\\}\\]");
System.out.println(newtext);
"type": "bin"
}
]
}]
},{"property": {
newtext=text.replace("\\}\\,\\s+(\r\n)+\\]",newpart);