Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

If else add regexmatch (#8059)

crazywoola44f963f281c2
diff --git a/api/core/workflow/nodes/if_else/if_else_node.py b/api/core/workflow/nodes/if_else/if_else_node.py
index 5f240df6b07..2b253764b7f 100644
--- a/api/core/workflow/nodes/if_else/if_else_node.py
+++ b/api/core/workflow/nodes/if_else/if_else_node.py
@@ -296,12 +296,7 @@ class IfElseNode(BaseNode):
"""
if actual_value is None:
return False
-
- pattern = re.compile(expected_value)
- regex_result = pattern.findall(actual_value)
- if len(regex_result) > 0:
- return True
- return False
+ return re.search(expected_value, actual_value) is not None
def _assert_not_empty(self, actual_value: Optional[str]) -> bool:
"""