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
though
New submission from Rick Otten:
The documentation states that "|" parsing goes from left to right. This
doesn't seem to be true when spaces are involved. (or \s).
Example:
In [40]: mystring
Out[40]: 'rwo incorporated'
In [41]: re.sub('incorporated
Changes by Rick Otten :
--
components: Regular Expressions
nosy: Rick Otten, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: regex "|" behavior differs from documentation
type: behavior
versions: Python 2.7