Rick Otten added the comment:

Can the documentation be updated to make this more clear?

I see now where the clause "As the target string is scanned, ..." is describing 
what you have listed here.

I and a coworker both read the description several times and missed that.  I 
thought it first tried "incorporated" against the whole string, then tried " 
inc" against the whole string, etc...  When actually it was trying each, 
"incorporated" and " inc" and the others against the first position of the 
string.  And then again for the second position.

Since I want to force the order against the whole string before trying the next 
one for my particular use case, I'll do a series of re.subs instead of trying 
to do them all in one.  It makes sense now and is easy to fix.

Thanks for looking at it and explaining what is happening more clearly.  It was 
really not obvious.  I tried at least 100 variations and wasn't seeing the 
pattern.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23532>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to