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

SourceForge.net noreply at sourceforge.net
Mon Jul 31 18:22:32 CEST 2006


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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Lukasz Pankowski (lupan)
>Assigned to: A.M. Kuchling (akuchling)
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.


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

>Comment By: A.M. Kuchling (akuchling)
Date: 2006-07-31 12:22

Message:
Logged In: YES 
user_id=11375

The suggested change seems reasonable, so I've applied it. 
Thanks!


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

Comment By: Neal Norwitz (nnorwitz)
Date: 2005-10-02 02:43

Message:
Logged In: YES 
user_id=33168

Gustavo, are you still interested in re issues?  This is
actually a doc issue (I think it's only a doc issue).  Any
comments?  I can make a change if you want me to, just let
me know what to do.

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

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