refactor(接口测试): 优化正则匹配模块规则 #26797

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-09-19 10:47:15 +08:00 committed by fit2-zhao
parent 0fd091c878
commit 6034f27ed1

View File

@ -96,7 +96,8 @@ public class MsExtract extends MsTestElement {
if (extractRegex.isMultipleMatching()) {
extractor.setMatchNumber(-1);
}
extractor.setTemplate("$1$");
// $1$提取 JSON 响应中的第一个匹配项 $0$用于提取整个 JSON 响应
extractor.setTemplate("$0$");
extract.add(extractor.getRefName());
return extractor;