This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2001-04-25.03:28:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Assigned to /F.  Works for me on Win98 under 2.1.  Binding 
m to the re result and then printing

print m.span(), len(output), m.span(1), m.span(2)

yields

(8, 12112) 12112 (25, 43) (44, 12111)

Anonymous, this is a poor use for regexps:  the code would 
be clearer, simpler and faster (plus it wouldn't blow up 
<wink>) if you used basic string operations instead.  The 
(.*?)\s*$ at the end is especially wasteful:  you're 
teilling the regexp engine to do 12,000+ useless match 
attempts there, when all you *want* is the entire tail end 
of the string stripped of trailing whitespace.  So just 
grab the tail end of the string directly and do 
string.rstrip() on it; saves 12,000+ useless matching 
attempts.
History
Date User Action Args
2007-08-23 13:54:15adminlinkissue418626 messages
2007-08-23 13:54:15admincreate