If else add regexmatch (#8059)

Co-authored-by: 罗威 <luowei@cvte.com>
This commit is contained in:
crazywoola 2024-09-06 18:35:51 +08:00 committed by GitHub
parent 01858e1caf
commit 44f963f281
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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:
"""