<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">Hi,</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">In: <br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><a href="https://docs.python.org/3/library/re.html#regular-expression-syntax">https://docs.python.org/3/library/re.html#regular-expression-syntax</a></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">at:<br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><dl class="gmail-docutils"><dt><code class="gmail-docutils gmail-literal"><span class="gmail-pre">\W</span></code></dt><dd>Matches any character which is not a word character. This is
the opposite of <code class="gmail-docutils gmail-literal"><span class="gmail-pre">\w</span></code>. If the <a class="gmail-reference gmail-internal" href="https://docs.python.org/3/library/re.html#re.ASCII" title="re.ASCII"><code class="gmail-xref gmail-py gmail-py-const gmail-docutils gmail-literal"><span class="gmail-pre">ASCII</span></code></a> flag is used this
becomes the equivalent of <code class="gmail-docutils gmail-literal"><span class="gmail-pre">[^a-zA-Z0-9_]</span></code> (but the flag affects the
entire regular expression, so in such cases using an explicit
<code class="gmail-docutils gmail-literal"><span class="gmail-pre">[^a-zA-Z0-9_]</span></code> may be a better choice).  If the <a class="gmail-reference gmail-internal" href="https://docs.python.org/3/library/re.html#re.LOCALE" title="re.LOCALE"><code class="gmail-xref gmail-py gmail-py-const gmail-docutils gmail-literal"><span class="gmail-pre">LOCALE</span></code></a> flag is
used, matches characters considered alphanumeric in the current locale
and the underscore.</dd></dl></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">shouldn't it be instead:</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><dl class="gmail-docutils"><dt><code class="gmail-docutils gmail-literal"><span class="gmail-pre">\W</span></code></dt><dd>Matches any character which is not a word character. This is
the opposite of <code class="gmail-docutils gmail-literal"><span class="gmail-pre">\w</span></code>. If the <a class="gmail-reference gmail-internal" href="https://docs.python.org/3/library/re.html#re.ASCII" title="re.ASCII"><code class="gmail-xref gmail-py gmail-py-const gmail-docutils gmail-literal"><span class="gmail-pre">ASCII</span></code></a> flag is used this
becomes the equivalent of <code class="gmail-docutils gmail-literal"><span class="gmail-pre">[^a-zA-Z0-9_]</span></code> (but the flag affects the
entire regular expression, so in such cases using an explicit
<code class="gmail-docutils gmail-literal"><span class="gmail-pre">[^a-zA-Z0-9_]</span></code> may be a better choice).  If the <a class="gmail-reference gmail-internal" href="https://docs.python.org/3/library/re.html#re.LOCALE" title="re.LOCALE"><code class="gmail-xref gmail-py gmail-py-const gmail-docutils gmail-literal"><span class="gmail-pre">LOCALE</span></code></a> flag is
used, matches characters <span style="background-color:rgb(0,255,255)">not</span> considered alphanumeric in the current locale
and the underscore.</dd></dl></div></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">?</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">Thanks.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)">Gilles.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(102,0,0)"><br clear="all"></div><div><div class="gmail_signature"><div dir="ltr"><font style="color:rgb(0,0,102)" size="2"><i style="font-family:georgia,serif">---</i></font><div><font style="color:rgb(0,0,102)" size="2"><i style="font-family:georgia,serif">Expect the best, plan for the worst, and prepare to be surprised. </i><br style="font-family:georgia,serif"><span style="font-family:georgia,serif">(Espère le meilleur, prépare-toi pour le pire & attends-toi à être surpris.)</span><br style="font-family:georgia,serif"><i style="font-family:georgia,serif"><br>Denis Waitley</i></font><br></div></div></div></div>
</div>