You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import java.util.regex;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Base64;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
String t_path = vars.get("path");
String answer = vars.get("t_content");
log.info("*********************这是调试日志*************************************", t_path);
t_path = t_path.split("; ")[0];
String pattern = ".*```.*?\n(.*)```.*";
Pattern r = Pattern.compile(pattern, Pattern.DOTALL);
Matcher m = r.matcher(answer);
if(m.find()) {
answer = m.group(1);
log.info("-----日志^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"+ answer);
}else{
answer = "not found***";
}
String answerInJson = JSON.toJSONString(answer);
vars.put("answer", answerInJson);
vars.put("t_path", t_path);