I need to get a JSON object from a String
in this string the JSON content is unique with this form:
abit2:{....};
I made my regex this way, but I'm unable to stop at semicolon
public String getJSON(String content) throws MalformedURLException, IOException{
String json = "";
String regex = "abit2:([\\s\\S]*)\\};";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(content);
while (matcher.find()) {
json = matcher.group().replace("abit2:", "");
}
return json;
}