diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java index 5247731ebd..ca85be8fa5 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java @@ -112,7 +112,7 @@ public class MsIfController extends MsTestElement { value = "\"" + this.value + "\""; } if (StringUtils.contains(operator, "~")) { - value = "\".*" + this.value + ".*\""; + value = "\"(\\n|.)*" + this.value + "(\\n|.)*\""; } if (StringUtils.equals(operator, "is empty")) { diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java index 8e9e64510d..fc84a96da2 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java @@ -126,7 +126,7 @@ public class MsLoopController extends MsTestElement { } if (StringUtils.contains(operator, "~")) { - value = "\".*" + this.whileController.getValue() + ".*\""; + value = "\"(\\n|.)*" + this.whileController.getValue() + "(\\n|.)*\""; } if (StringUtils.equals(operator, "is empty")) {