From 8015c4500bcdf8cf42d110d8c51ab4b7be2299fd Mon Sep 17 00:00:00 2001 From: Qi Zhang <25192197+singularitti@users.noreply.github.com> Date: Sat, 28 Oct 2023 04:59:20 -0400 Subject: [PATCH] Fix the regex `NUMBER_PATTERN` in _input_base.py --- src/qe_tools/parsers/_input_base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qe_tools/parsers/_input_base.py b/src/qe_tools/parsers/_input_base.py index e2f264a..aab7d24 100644 --- a/src/qe_tools/parsers/_input_base.py +++ b/src/qe_tools/parsers/_input_base.py @@ -20,15 +20,15 @@ NUMBER_PATTERN = r""" (?: - [-|+]? # Plus or minus in front of the number (optional) + [-+]? # Plus or minus in front of the number (optional) (?:\d* # optional decimal in the beginning .0001 is ok, for example - [\.] # There has to be a dot followed by + \. # There has to be a dot followed by \d+) # at least one decimal | # OR (?:\d+ # at least one decimal, followed by - [\.]? # an optional dot + \.? # an optional dot \d*) # followed by optional decimals - (?:[E|e|d|D][+|-]?\d+)? # optional exponents E+03, e-05, d0, D0 + (?:[EedD][+-]?\d+)? # optional exponents E+03, e-05, d0, D0 ) """