public static void main(String[] args) {
List<String> beanList = new ArrayList<>();
String content = "{\"acsRequestBeanList\":[{\"mac\":\"00:0D:2D:34:84:40\",\"acsMethods\":[{\"method\":\"Reboot\",\"requestId\":\"1_1473473073377296386\",\"params\":null}]}]}";
beanList.add(content);
beanList.add(content);
beanList.add(content);
String pattern = "\\{\"acsRequestBeanList\"\\:\\[(.+)\\]\\}";
Pattern p = Pattern.compile(pattern);
StringBuffer builder = new StringBuffer();
builder.append("{\"acsRequestBeanList\":[");
for (String str : beanList) {
Matcher m = p.matcher(str);
if (m.find()) {
String item = m.group(1);
builder.append(item);
builder.append(",");
}
}
builder.append("]}");
}