[docs] Bug?

Gilles Feyrit gilles.feyrit at gmail.com
Wed Jan 10 03:08:23 EST 2018


Hi,

In:
https://docs.python.org/3/library/re.html#regular-expression-syntax
at:
\WMatches any character which is not a word character. This is the opposite
of \w. If the ASCII <https://docs.python.org/3/library/re.html#re.ASCII>
flag is used this becomes the equivalent of [^a-zA-Z0-9_] (but the flag
affects the entire regular expression, so in such cases using an explicit
[^a-zA-Z0-9_] may be a better choice). If the LOCALE
<https://docs.python.org/3/library/re.html#re.LOCALE> flag is used, matches
characters considered alphanumeric in the current locale and the underscore.
shouldn't it be instead:
\WMatches any character which is not a word character. This is the opposite
of \w. If the ASCII <https://docs.python.org/3/library/re.html#re.ASCII>
flag is used this becomes the equivalent of [^a-zA-Z0-9_] (but the flag
affects the entire regular expression, so in such cases using an explicit
[^a-zA-Z0-9_] may be a better choice). If the LOCALE
<https://docs.python.org/3/library/re.html#re.LOCALE> flag is used, matches
characters not considered alphanumeric in the current locale and the
underscore.
?
Thanks.

Gilles.

*---*
*Expect the best, plan for the worst, and prepare to be surprised. *
(Espère le meilleur, prépare-toi pour le pire & attends-toi à être surpris.)

*Denis Waitley*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20180110/b31c177c/attachment.html>


More information about the docs mailing list