diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index 84f918085ea670..5715234b40f686 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -1225,8 +1225,7 @@ def _config_variable_substitution(self, value): # But some other tests were relying on the fact that the expression was put 'as if' in # the generated code and was resolved before being sent over the wire. For such # expressions (e.g 'myVar + 1') we need to compute it before sending it over the wire. - delimiter_regex = "(\ |\(|\)|\+|\-|\*|\/|\%)" - tokens = re.split(delimiter_regex, value) + tokens = re.split("([- ()|+*/%])", value) if len(tokens) == 0: return value