From 11d58c1e25dcbd484565797cdf6569dbb65b662d Mon Sep 17 00:00:00 2001 From: Adam Heins Date: Fri, 23 Feb 2024 11:17:47 -0500 Subject: [PATCH] Escape regexes using raw strings. --- xacro/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xacro/__init__.py b/xacro/__init__.py index a16dc90..2aeb91e 100644 --- a/xacro/__init__.py +++ b/xacro/__init__.py @@ -555,8 +555,8 @@ def is_valid_name(name): return False -default_value = '''\$\{.*?\}|\$\(.*?\)|(?:'.*?'|\".*?\"|[^\s'\"]+)+|''' -re_macro_arg = re.compile(r'^\s*([^\s:=]+?)\s*:?=\s*(\^\|?)?(' + default_value + ')(?:\s+|$)(.*)') +default_value = r'''\$\{.*?\}|\$\(.*?\)|(?:'.*?'|\".*?\"|[^\s'\"]+)+|''' +re_macro_arg = re.compile(r'^\s*([^\s:=]+?)\s*:?=\s*(\^\|?)?(' + default_value + r')(?:\s+|$)(.*)') # space( param )( := )( ^| )( default )( space )(rest)