|
|
@ -443,17 +443,20 @@ to_exclusive = <range>.stop |
|
|
|
<li><strong>Also: <code class="python hljs"><span class="hljs-string">'lstrip()'</span></code>, <code class="python hljs"><span class="hljs-string">'rstrip()'</span></code>.</strong></li> |
|
|
|
<li><strong>Also: <code class="python hljs"><span class="hljs-string">'lower()'</span></code>, <code class="python hljs"><span class="hljs-string">'upper()'</span></code>, <code class="python hljs"><span class="hljs-string">'capitalize()'</span></code> and <code class="python hljs"><span class="hljs-string">'title()'</span></code>.</strong></li> |
|
|
|
</ul> |
|
|
|
<div><h3 id="propertymethods">Property Methods</h3><pre><code class="text language-text">+---------------+----------+----------+----------+----------+----------+----------+ |
|
|
|
| | [\t\n\r] | [ !#$%…] | [A-Za-z] | [¼½¾…] | [¹²³…] | [0-9] | |
|
|
|
+---------------+----------+----------+----------+----------+----------+----------+ |
|
|
|
| isprintable() | | yes | yes | yes | yes | yes | |
|
|
|
| isalnum() | | | yes | yes | yes | yes | |
|
|
|
| isnumeric() | | | | yes | yes | yes | |
|
|
|
| isdigit() | | | | | yes | yes | |
|
|
|
| isdecimal() | | | | | | yes | |
|
|
|
+---------------+----------+----------+----------+----------+----------+----------+ |
|
|
|
<div><h3 id="propertymethods">Property Methods</h3><pre><code class="text language-text">+---------------+----------+----------+----------+----------+----------+ |
|
|
|
| | [ !#$%…] | [a-zA-Z] | [¼½¾…] | [¹²³…] | [0-9] | |
|
|
|
+---------------+----------+----------+----------+----------+----------+ |
|
|
|
| isprintable() | yes | yes | yes | yes | yes | |
|
|
|
| isalnum() | | yes | yes | yes | yes | |
|
|
|
| isnumeric() | | | yes | yes | yes | |
|
|
|
| isdigit() | | | | yes | yes | |
|
|
|
| isdecimal() | | | | | yes | |
|
|
|
+---------------+----------+----------+----------+----------+----------+ |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
<ul> |
|
|
|
<li><strong>Also: <code class="python hljs"><span class="hljs-string">'isspace()'</span></code> checks for <code class="python hljs"><span class="hljs-string">'[ \t\n\r…]'</span></code>.</strong></li> |
|
|
|
</ul> |
|
|
|
<div><h2 id="regex"><a href="#regex" name="regex">#</a>Regex</h2><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> re |
|
|
|
<str> = re.sub(<regex>, new, text, count=<span class="hljs-number">0</span>) <span class="hljs-comment"># Substitutes all occurrences.</span> |
|
|
|
<list> = re.findall(<regex>, text) <span class="hljs-comment"># Returns all occurrences.</span> |
|
|
|