diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-28 12:07:05 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-28 12:07:05 -0400 |
commit | 16e09bb5648141bae0b4b43adf57b18a64ea5ae4 (patch) | |
tree | fb7eeff7770a1d405ea20910935a8ade2966e417 /cmd2/parsing.py | |
parent | e769830316ada4109f3b965aabb4ba1b68274686 (diff) | |
download | cmd2-git-16e09bb5648141bae0b4b43adf57b18a64ea5ae4.tar.gz |
Removed unneeded escapes in regular expressions
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r-- | cmd2/parsing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 6c687439..e90eac43 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -34,12 +34,12 @@ class MacroArg: # Pattern used to find normal argument # Digits surrounded by exactly 1 brace on a side and 1 or more braces on the opposite side # Match strings like: {5}, {{{{{4}, {2}}}}} - macro_normal_arg_pattern = re.compile(r'(?<!\{)\{\d+\}|\{\d+\}(?!\})') + macro_normal_arg_pattern = re.compile(r'(?<!{){\d+}|{\d+}(?!})') # Pattern used to find escaped arguments # Digits surrounded by 2 or more braces on both sides # Match strings like: {{5}}, {{{{{4}}, {{2}}}}} - macro_escaped_arg_pattern = re.compile(r'\{{2}\d+\}{2}') + macro_escaped_arg_pattern = re.compile(r'{{2}\d+}{2}') # Finds a string of digits digit_pattern = re.compile(r'\d+') |