From 96fba067098cf942fd5308708caeda0186e20806 Mon Sep 17 00:00:00 2001 From: "Sam G." Date: Sun, 18 Aug 2024 14:14:51 -0700 Subject: [PATCH] fix bug in template exec pattern --- symconf/template.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symconf/template.py b/symconf/template.py index 6ef9598..39fef1a 100644 --- a/symconf/template.py +++ b/symconf/template.py @@ -14,7 +14,7 @@ class Template: self, template_str : str, key_pattern : str = r'f{{(\S+?)}}', - exe_pattern : str = r'x{{(.*)}}', + exe_pattern : str = r'x{{((?:(?!x{{).)*)}}', ): self.template_str = template_str self.key_pattern = key_pattern @@ -67,7 +67,7 @@ class FileTemplate(Template): self, path: Path, key_pattern: str = r'f{{(\S+?)}}', - exe_pattern: str = r'x{{(.*)}}', + exe_pattern : str = r'x{{((?:(?!x{{).)*)}}', ): super().__init__( path.open('r').read(), @@ -80,7 +80,7 @@ class TOMLTemplate(FileTemplate): self, toml_path: Path, key_pattern: str = r'f{{(\S+?)}}', - exe_pattern: str = r'x{{(.*)}}', + exe_pattern : str = r'x{{((?:(?!x{{).)*)}}', ): super().__init__( toml_path,