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
Branches
Tags
1 merge request!5Development
Pipeline #6707 passed
...@@ -33,8 +33,8 @@ TYPE_PRIORITY_ORDER = ( ...@@ -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_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 = '(([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_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): class Remote(object):
...@@ -142,10 +142,10 @@ class Remote(object): ...@@ -142,10 +142,10 @@ class Remote(object):
for elt in value: for elt in value:
return evaluate(elt) return evaluate(elt)
if isinstance(value, str): if isinstance(value, str):
if re.match("^\d+?\.\d+?$", value): if re.match(r"^\d+?\.\d+?$", value):
# TODO float/double # TODO float/double
return 'float' return 'float'
elif re.match("^-?(?!0)\d+$", value): elif re.match(r"^-?(?!0)\d+$", value):
# TODO short/integer/long # TODO short/integer/long
return 'int' return 'int'
# TODO: date... ip... binary... object... boolean... # 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