Commit 915f377e authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

remove regex warnings

parent 1a4a201f
Pipeline #6707 passed with stages
in 19 seconds
......@@ -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...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment