From 51a77c695be7fcc47c4e67d3f308e62bc9283417 Mon Sep 17 00:00:00 2001 From: Davte Date: Tue, 25 Jul 2023 18:58:31 +0200 Subject: [PATCH] Better variable regex: accept only one decimal separator in float numbers --- davtelepot/__init__.py | 2 +- davtelepot/administration_tools.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index f3ebca5..ed52bc4 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -11,7 +11,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.9.2" +__version__ = "2.9.3" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/administration_tools.py b/davtelepot/administration_tools.py index b83b2bc..55fdccb 100644 --- a/davtelepot/administration_tools.py +++ b/davtelepot/administration_tools.py @@ -36,8 +36,9 @@ from davtelepot.utilities import ( rows_number_limit = 10 command_description_parser = re.compile(r'(?P\w+)(\s?-\s?(?P.*))?') -variable_regex = re.compile(r"(?P[a-zA-Z][\w]*)\s*=\s*" - r"(?P[\d.,]+|True|False|" +variable_regex = re.compile(r"(?P[a-zA-Z]\w*)\s*=\s*" + r"(?P\d*[.,]?\d+|" + r"True|False|" r"'[^']*'|" r"\"[^\"]*\")")