正则表达式截取字符串内容
Pattern pattern = Pattern.compile("(\\{)(.+?)(\\})");
String test = "callback( {\"client_id\":\"222222\",\"openid\":\"122121\",\"unionid\":\"ddddddddd\"} );";
Matcher matcher = pattern.matcher(test);
while (matcher.find()){
System.out.println(matcher.group());
}
部分说明: