<li><strong>Search() and match() return None if they can't find a match.</strong></li>
<li><strong>Argument <codeclass="python hljs"><spanclass="hljs-string">'flags=re.IGNORECASE'</span></code> can be used with all functions.</strong></li>
<li><strong>Argument <codeclass="python hljs"><spanclass="hljs-string">'flags=re.MULTILINE'</span></code> makes <codeclass="python hljs"><spanclass="hljs-string">'^'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'$'</span></code> match the start/end of each line.</strong></li>
<li><strong>Argument <codeclass="python hljs"><spanclass="hljs-string">'flags=re.DOTALL'</span></code> makes dot also accept the <codeclass="python hljs"><spanclass="hljs-string">'\n'</span></code>.</strong></li>
<li><strong>Argument <codeclass="python hljs"><spanclass="hljs-string">'flags=re.DOTALL'</span></code> makes <codeclass="python hljs"><spanclass="hljs-string">'.'</span></code> also accept the <codeclass="python hljs"><spanclass="hljs-string">'\n'</span></code>.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">r'\1'</span></code> or <codeclass="python hljs"><spanclass="hljs-string">'\\1'</span></code> for backreference (<codeclass="python hljs"><spanclass="hljs-string">'\1'</span></code> returns a character with octal code 1).</strong></li>
<li><strong>Add <codeclass="python hljs"><spanclass="hljs-string">'?'</span></code> after <codeclass="python hljs"><spanclass="hljs-string">'*'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'+'</span></code> to make them non-greedy.</strong></li>
</ul>
@ -674,7 +674,7 @@ func(*args, **kwargs)
<div><h3id="conditionalexpression">Conditional Expression</h3><pre><codeclass="python language-python hljs"><obj> = <exp><spanclass="hljs-keyword">if</span><condition><spanclass="hljs-keyword">else</span><exp><spanclass="hljs-comment"># Only one expression gets evaluated.</span>
</code></pre></div>
<pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>[a <spanclass="hljs-keyword">if</span> a <spanclass="hljs-keyword">else</span><spanclass="hljs-string">'zero'</span><spanclass="hljs-keyword">for</span> a <spanclass="hljs-keyword">in</span> (<spanclass="hljs-number">0</span>, <spanclass="hljs-number">1</span>, <spanclass="hljs-number">2</span>, <spanclass="hljs-number">3</span>)]
<pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>[a <spanclass="hljs-keyword">if</span> a <spanclass="hljs-keyword">else</span><spanclass="hljs-string">'zero'</span><spanclass="hljs-keyword">for</span> a <spanclass="hljs-keyword">in</span> (<spanclass="hljs-number">0</span>, <spanclass="hljs-number">1</span>, <spanclass="hljs-number">2</span>, <spanclass="hljs-number">3</span>)]<spanclass="hljs-comment"># `any([0, '', [], None]) == False`</span>
Direction = Enum(<spanclass="hljs-string">'Direction'</span>, <spanclass="hljs-string">'n e s w'</span>) <spanclass="hljs-comment"># Creates an enum.</span>
direction = Direction.n<spanclass="hljs-comment"># Returns its member.</span>
Direction = Enum(<spanclass="hljs-string">'Direction'</span>, <spanclass="hljs-string">'N E S W'</span>) <spanclass="hljs-comment"># Creates an enum.</span>
direction = Direction.N<spanclass="hljs-comment"># Returns its member.</span>
Player = make_dataclass(<spanclass="hljs-string">'Player'</span>, [<spanclass="hljs-string">'loc'</span>, <spanclass="hljs-string">'dir'</span>]) <spanclass="hljs-comment"># Creates a class.</span>
<div><h4id="userdefinedfunctionscannotbevaluessotheymustbewrapped">User-defined functions cannot be values, so they must be wrapped:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> functools <spanclass="hljs-keyword">import</span> partial
<el> = <Queue>.get_nowait() <spanclass="hljs-comment"># Raises queue.Empty exception if empty.</span>
</code></pre>
<div><h2id="operator"><ahref="#operator"name="operator">#</a>Operator</h2><p><strong>Module of functions that provide the functionality of operators.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> operator <spanclass="hljs-keyword">as</span> op
<div><h3id="inheritancediagram">Inheritance Diagram</h3><pre><codeclass="python language-python hljs">MyClass.__base__ == object <spanclass="hljs-comment"># MyClass is a subclass of object.</span>
@ -1876,9 +1873,9 @@ MyMetaClass.__base__ == type <span class="hljs-comment"># MyMetaClass is