[ python-Bugs-848556 ] 4.2.6 (re) Examples: float regexp exponential on failure

SourceForge.net noreply at sourceforge.net
Mon Nov 24 15:01:40 EST 2003


Bugs item #848556, was opened at 2003-11-24 21:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=848556&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Lukasz Pankowski (lupan)
Assigned to: Nobody/Anonymous (nobody)
Summary: 4.2.6 (re) Examples: float regexp exponential on failure

Initial Comment:
When using given regexp for floats

[-+]?(\d+(\.\d*)?|\d*\.\d+)([eE][-+]?\d+)?

'0.5' will match both alternatives on failure, which
makes exponential number of matches on failure if
matching multiple float numbers  '0.5 0.5 0.5' using
one regexp which fail at the end (attached test script).

If replaced with slightly less verbose (without '\d*'
after '|'):

[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?

'0.5' fails on the second branch and the exponential
effect does not occur.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=848556&group_id=5470



More information about the Python-bugs-list mailing list