[docs] Suggested Edit of re Doc

Douglas Morris dougbmorris at yahoo.com
Wed Jan 25 13:23:18 EST 2017

Dear Python volunteers,

Thanks for you work. I am learning Python (a newbie) and have a suggestion. The FAQ has an explanation on the syntactical requirement of raw strings, which is nice enough when you are looking at it or remember looking at it. Newbies who read the re documentation first may have a different experience.

The Standard Library Documentation for module re reads in section 6.2 (the beginning of the re documentation):The solution is to use Python’s raw string notation for regular expressionpatterns; backslashes are not handled in any special way in a string literalprefixed with 'r'.
I suggest changing that to:
The solution is to use Python’s raw string notation for regular expressionpatterns. Backslash escapes are not actually replaced in raw strings, but the backslashes are still required to syntactically permit such replacement in subsequent processing. Consequently, the content of string literals with the 'r' prefix have exactly one syntactic requirement: the total number of consecutive backslashes at the end must be even (possibly zero). Douglas Morris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20170125/db143743/attachment.html>

More information about the docs mailing list