Skip to content
Snippets Groups Projects
Commit 915f377e authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

remove regex warnings

parent 1a4a201f
No related branches found
No related tags found
1 merge request!5Development
Checking pipeline status
......@@ -33,8 +33,8 @@ TYPE_PRIORITY_ORDER = (
)
VALID_IP_ADDRESS_REGEX = '(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'
VALID_HOSTNAME_ADDRESS = '(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])'
VALID_IP_ADDRESS_REGEX = r'(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'
VALID_HOSTNAME_ADDRESS = r'(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])'
class Remote(object):
......@@ -142,10 +142,10 @@ class Remote(object):
for elt in value:
return evaluate(elt)
if isinstance(value, str):
if re.match("^\d+?\.\d+?$", value):
if re.match(r"^\d+?\.\d+?$", value):
# TODO float/double
return 'float'
elif re.match("^-?(?!0)\d+$", value):
elif re.match(r"^-?(?!0)\d+$", value):
# TODO short/integer/long
return 'int'
# TODO: date... ip... binary... object... boolean...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment