<div dir="ltr"><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">In the following page:</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><a href="https://docs.python.org/3.5/howto/regex.html#matching-characters" style="color:rgb(5,99,193)">https://docs.python.org/3.5/howto/regex.html#matching-characters</a></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> </p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The following 2 paragraphs are contradictory:</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> </p>
<p style="text-align:justify;line-height:16.8pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin-right:0in;margin-left:0in;font-size:12pt;font-family:"Times New Roman",serif"><span style="font-family:Arial,sans-serif;background:yellow">Metacharacters are not active inside classes.</span><span style="font-family:Arial,sans-serif"> For example, </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">[akm$]</span></span></span><span style="font-family:Arial,sans-serif"> will match any of
the characters </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'a'</span></span></span><span style="font-family:Arial,sans-serif">, </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'k'</span></span></span><span style="font-family:Arial,sans-serif">, </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'m'</span></span></span><span style="font-family:Arial,sans-serif">, or </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'$'</span></span></span><span style="font-family:Arial,sans-serif">; </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'$'</span></span></span><span style="font-family:Arial,sans-serif"> is usually a metacharacter, but inside a character class
it’s stripped of its special nature.</span></p>
<p style="text-align:justify;line-height:16.8pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin-right:0in;margin-left:0in;font-size:12pt;font-family:"Times New Roman",serif"><span style="font-family:Arial,sans-serif">You can match
the characters not listed within the class by <em>complementing</em> the set. This is indicated
by including a </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'^'</span></span></span><span style="font-family:Arial,sans-serif"> as the first character of the class; </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'^'</span></span></span><span style="font-family:Arial,sans-serif"> outside a character
class will simply match the </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:rgb(236,240,243)"><span style="hyphens: none;">'^'</span></span></span><span style="font-family:Arial,sans-serif">character. <span style="background:yellow">For
example, </span></span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:yellow"><span style="hyphens: none;">[^5]</span></span></span><span style="font-family:Arial,sans-serif;background:yellow"> will match any character except </span><span class="gmail-pre"><span style="font-size:11.5pt;font-family:"Courier New";background:yellow"><span style="hyphens: none;">'5'</span></span></span><span style="font-family:Arial,sans-serif;background:yellow">.</span><span style="font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The first paragraph says metacharacters are not active
inside character classes.</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The second paragraph shows an example of a metacharacter in
a character class having some “special nature”. In the example, it is treated as
the inverse or complement.</p><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font size="4" face="georgia, serif">Ovidiu Durbalau</font><div><font size="4" face="georgia, serif"><br></font></div><div><br>Software Developer | <a href="http://www.houle.ca" target="_blank">Houle</a></div><div>Computing Science Major | <a href="http://sfu.ca" target="_blank">Simon Fraser University</a></div><div>604 754 9116 | <a href="http://ca.linkedin.com/pub/ovidiu-durbalau/5b/709/463" target="_blank">LinkedIn</a> | <a href="https://twitter.com/divodurbalau" target="_blank">Twitter </a>| <a href="https://www.facebook.com/crusarovid" target="_blank">Facebook</a></div></div></div></div></div></div>