diff --git a/lib/yaml/resolver.py b/lib/yaml/resolver.py index 3522bdaa..8fb170b2 100644 --- a/lib/yaml/resolver.py +++ b/lib/yaml/resolver.py @@ -176,8 +176,8 @@ class Resolver(BaseResolver): Resolver.add_implicit_resolver( 'tag:yaml.org,2002:float', - re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)? - |\.[0-9][0-9_]*(?:[eE][-+][0-9]+)? + re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+]?[0-9]+)? + |\.[0-9][0-9_]*(?:[eE][-+]?[0-9]+)? |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]* |[-+]?\.(?:inf|Inf|INF) |\.(?:nan|NaN|NAN))$''', re.X),