[Python-bugs-list] [ python-Bugs-732120 ] An extended definition of "non-overlapping" would save time.

SourceForge.net noreply at sourceforge.net
Sat Aug 30 23:31:35 EDT 2003


Bugs item #732120, was opened at 2003-05-04 04:56
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=732120&group_id=5470

Category: Documentation
Group: Feature Request
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Philip Jägenstedt (foolip)
Assigned to: Raymond Hettinger (rhettinger)
Summary: An extended definition of "non-overlapping" would save time.

Initial Comment:
Hello.

Yesterday I spent several hours trying to figure out
why a (stupid) regex like "^|foo" didn't return ['',
'foo'] for findall("foo").

Like this:

|f|o|o|
0 1 2 3

I figured the ^ would match 0-0 and then a 0-3 match
for foo. I've learnt since that the reason this can't
happen is because the regexp engine would get caught in
an infinte loop. However, the two matches aren't really
overlapping, and the docs state that all
non-overlapping matches would be returned.

I suggest therefor that it is clarified in the docs
that non-overlapping doesn't apply to a zero-length
match at the beginning of another potential match.

This would apply to findall and finditer in
doc/python2.2/html/lib/node99.html.

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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-08-31 00:31

Message:
Logged In: YES 
user_id=80475

Nice catch.

Applied fix to Doc/lib/libre.tex 1.103 and  1.101.8.2

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

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



More information about the Python-bugs-list mailing list