>>> help(sre) ... "$" Matches the end of the string. ... \Z Matches only at the end of the string. ... M MULTILINE "^" matches the beginning of lines as well as the string. "$" matches the end of lines as well as the string. The docs for "$" are misleading - it actually matches in newline-specific ways which the module's built-in docs don't hint at. The MULTILINE docs don't clarify this. I'd also like to see "from sre import __doc__" added to the end of re.py; lack of "help(re)" is a bigger problem than having slightly wrong auto-generated docs for the re module itself.
The re.__doc__ problem is gone; the problem that the $ documentation doesn't give a complete specification persists. Fredrik, do you have an opinion on this? If not, please unassign.
Thanks for fixing this. I now also note that (?<=...), (?<!...) and (? (id/name)yes-pattern|no-pattern) aren't documented, and nor is finditer in the main docstring. The attached patch fixes these, as well as what looks like mistaken formatting on one line. Some of the proposed lines are a bit long for help(re), but they're hard to shorten.