[Python-bugs-list] [ python-Bugs-803842 ] Wrong description of
regexp concatenation
SourceForge.net
noreply at sourceforge.net
Wed Sep 10 12:48:51 EDT 2003
Bugs item #803842, was opened at 2003-09-10 11:37
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=803842&group_id=5470
Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Hallvard B Furuseth (hfuru)
Assigned to: Nobody/Anonymous (nobody)
Summary: Wrong description of regexp concatenation
Initial Comment:
http://www.python.org/doc/current/lib/re-syntax.html
says:
If a string p matches A and another string q matches B,
the string pq will match AB if A and B do no specify
boundary conditions that are no longer satisfied by pq.
This is not true if A or B contains an unparenthesized
"|": A = "x|y", B = "z", p = "x", q = "z".
Nor if A contains parentheses and B contains \number.
A = "(x)", B = r'(.)\1', p = "x", q = "yy".
Nor if A or B contains a (?...) which modifies the
behaviour of the entire regular expression.
Nor if B contains (?<!...) matching AB, including
a portion of A.
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-09-10 13:48
Message:
Logged In: YES
user_id=80475
These two exceptions (low precedence operations and group
numbering) seem obvious to me; however, precedence errors
with | is are common. Accordingly, I've updated the docs to
the two exceptions to the general rule.
Thanks for the report.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=803842&group_id=5470
More information about the Python-bugs-list
mailing list