public static void main(String[] args)throws Exception {
Map map = new HashMap();
String str = "{Group:{\"id\":\"9\",\"name\":\"hoochiang\",\"columns\":[{\"lev\":\"SEQ_SDPI_DASHBOARD\",\"col\":\"uuu\"},{\"lev\":\"TTT_UUU_YYY\",\"col\":\"ooo\"}]}}";
//Pattern p = Pattern.compile("[\\w[^\\[\\],{}]]+");
Pattern p = Pattern.compile("(?:\"\\w+\"):(?:\"[^\"]+\")");
//Matcher m = p.matcher(json.replaceAll("'|\"", ""));
Matcher m = p.matcher(str);
String[] _strs = null;
while (m.find()) {
_strs = m.group().split(":");
if(_strs.length == 2 )
map.put(_strs[0].replaceAll("'|\"", ""), _strs[1].trim().replaceAll("'|\"", ""));
}
System.out.println(map);
}
Map map = new HashMap();
String str = "{Group:{\"id\":\"9\",\"name\":\"hoochiang\",\"columns\":[{\"lev\":\"SEQ_SDPI_DASHBOARD\",\"col\":\"uuu\"},{\"lev\":\"TTT_UUU_YYY\",\"col\":\"ooo\"}]}}";
//Pattern p = Pattern.compile("[\\w[^\\[\\],{}]]+");
Pattern p = Pattern.compile("(?:\"\\w+\"):(?:\"[^\"]+\")");
//Matcher m = p.matcher(json.replaceAll("'|\"", ""));
Matcher m = p.matcher(str);
String[] _strs = null;
while (m.find()) {
_strs = m.group().split(":");
if(_strs.length == 2 )
map.put(_strs[0].replaceAll("'|\"", ""), _strs[1].trim().replaceAll("'|\"", ""));
}
System.out.println(map);
}