diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 875bbe153b..b276469d09 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -76,7 +76,7 @@ class GcodeStartEndFormatter: # will be used. Alternatively, if the expression is formatted as "{[expression], [extruder_nr]}", # then the expression will be evaluated with the extruder stack of the specified extruder_nr. - _instruction_regex = re.compile(r"{(?Pif|else|elif|endif)?\s*(?P.*?)\s*(?:,\s*(?P.*))?\s*}(?P\n?)") + _instruction_regex = re.compile(r"{(?Pif|else|elif|endif)?\s*(?P[^{}]*?)\s*(?:,\s*(?P[^{}]*))?\s*}(?P\n?)") def __init__(self, all_extruder_settings: Dict[str, Dict[str, Any]], default_extruder_nr: int = -1) -> None: super().__init__()