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 tlynn
Recipients georg.brandl, loewis, mrabarnett, niemeyer, r.david.murray, rhettinger, timehorse, tlynn
Date 2010-09-19.00:12:57
SpamBayes Score 2.4012402e-07
Marked as misclassified No
Message-id <1284855182.02.0.86487141542.issue1708652@psf.upfronthosting.co.za>
In-reply-to
Content
(Sorry to comment on a closed issue, it was closed as I was writing this.)  It's not that I'm not convinced of the need, just not of the solution.  I still think that there are problems here:

a) forgetting any \Z or $ terminator to .match() is easy,
b) $ is easily misunderstood (and not just by me) and I suspect commonly dangerously misused in validation routines as a result,
c) '(?:%s)\Z' % regexp is noisy, combines two less-understood features, and makes simple regexps hard to read,
d) '(?:%s)\Z' % regexp.pattern requires recompilation of the regexp.

I think another method is probably the best solution to these, but it may have too much cost (though I'm not sure what that cost would be).

Largely orthogonally, I'd like to see \Z encouraged over $ in the docs, and preferably a version of this table (probably under Matching vs Searching), corrected if I'm wrong of course:

NON-MULTILINE:
    '^' is equivalent to '\A'
    '$' is equivalent to '(?:\Z|(?=\n\Z))'

MULTILINE:
    '^' is equivalent to '(?:\A|(?<=\n))'
    '$' is equivalent to '(?:\Z|(?=\n))'

But the docs already try to express the above table (or its correction) in English, so you may feel it wouldn't add anything, in which case I'd still like to see any corrections for my own edification if possible.
History
Date User Action Args
2010-09-19 00:13:03tlynnsetrecipients: + tlynn, loewis, georg.brandl, rhettinger, niemeyer, timehorse, mrabarnett, r.david.murray
2010-09-19 00:13:02tlynnsetmessageid: <1284855182.02.0.86487141542.issue1708652@psf.upfronthosting.co.za>
2010-09-19 00:13:00tlynnlinkissue1708652 messages
2010-09-19 00:12:57tlynncreate