BeanShell 后置处理程序 提取记录

import java.util.regex.Matcher;
import java.util.regex.Pattern;

String responseData = prev.getResponseDataAsString();
Pattern pattern = Pattern.compile("砖石数\\[([0-9]+)\\]");
Matcher matcher = pattern.matcher(responseData);

if (matcher.find()) {
String diamonds = matcher.group(1);
vars.put("diamonds", diamonds);
}


 

posted @ 2023-06-30 14:14  Catonce  阅读(77)  评论(0编辑  收藏  举报