Better variable regex: accept only one decimal separator in float numbers

This commit is contained in:
Davte 2023-07-25 18:58:31 +02:00
parent febe5cee3f
commit 51a77c695b
Signed by: Davte
GPG Key ID: 81F45E046B2D138E
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it" __email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0" __license__ = "GNU General Public License v3.0"
__version__ = "2.9.2" __version__ = "2.9.3"
__maintainer__ = "Davide Testa" __maintainer__ = "Davide Testa"
__contact__ = "t.me/davte" __contact__ = "t.me/davte"

View File

@ -36,8 +36,9 @@ from davtelepot.utilities import (
rows_number_limit = 10 rows_number_limit = 10
command_description_parser = re.compile(r'(?P<command>\w+)(\s?-\s?(?P<description>.*))?') command_description_parser = re.compile(r'(?P<command>\w+)(\s?-\s?(?P<description>.*))?')
variable_regex = re.compile(r"(?P<name>[a-zA-Z][\w]*)\s*=\s*" variable_regex = re.compile(r"(?P<name>[a-zA-Z]\w*)\s*=\s*"
r"(?P<value>[\d.,]+|True|False|" r"(?P<value>\d*[.,]?\d+|"
r"True|False|"
r"'[^']*'|" r"'[^']*'|"
r"\"[^\"]*\")") r"\"[^\"]*\")")