summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--pyparsing/common.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 353f208..822d220 100644
--- a/CHANGES
+++ b/CHANGES
@@ -163,6 +163,10 @@ Version 3.0.0a1
- Fixed bug in delta_time.py example, when using a quantity
of seconds/minutes/hours/days > 999.
+- Fixed bug in regex definitions for real and sci_real expressions in
+ pyparsing_common. Issue #194, reported by Michael Wayne Goodman, thanks!
+
+
Version 2.4.6 - December, 2019
------------------------------
- Fixed typos in White mapping of whitespace characters, to use
diff --git a/pyparsing/common.py b/pyparsing/common.py
index 3d0285a..f6eccf2 100644
--- a/pyparsing/common.py
+++ b/pyparsing/common.py
@@ -185,14 +185,14 @@ class pyparsing_common:
mixed_integer.addParseAction(sum)
real = (
- Regex(r"[+-]?(:?\d+\.\d*|\.\d+)")
+ Regex(r"[+-]?(?:\d+\.\d*|\.\d+)")
.setName("real number")
.setParseAction(convertToFloat)
)
"""expression that parses a floating point number and returns a float"""
sci_real = (
- Regex(r"[+-]?(:?\d+(:?[eE][+-]?\d+)|(:?\d+\.\d*|\.\d+)(:?[eE][+-]?\d+)?)")
+ Regex(r"[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)")
.setName("real number with scientific notation")
.setParseAction(convertToFloat)
)