diff --git a/yamllint/rules/float_values.py b/yamllint/rules/float_values.py index 7c7c60cc..5f2c44e8 100644 --- a/yamllint/rules/float_values.py +++ b/yamllint/rules/float_values.py @@ -106,13 +106,13 @@ } IS_NUMERAL_BEFORE_DECIMAL_PATTERN = ( - re.compile('[-+]?(\\.[0-9]+)([eE][-+]?[0-9]+)?$') + re.compile(r'[-+]?(\.[0-9]+)([eE][-+]?[0-9]+)?$') ) IS_SCIENTIFIC_NOTATION_PATTERN = re.compile( - '[-+]?(\\.[0-9]+|[0-9]+(\\.[0-9]*)?)([eE][-+]?[0-9]+)$' + r'[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)$' ) -IS_INF_PATTERN = re.compile('[-+]?(\\.inf|\\.Inf|\\.INF)$') -IS_NAN_PATTERN = re.compile('(\\.nan|\\.NaN|\\.NAN)$') +IS_INF_PATTERN = re.compile(r'[-+]?(\.inf|\.Inf|\.INF)$') +IS_NAN_PATTERN = re.compile(r'(\.nan|\.NaN|\.NAN)$') def check(conf, token, prev, next, nextnext, context):