Browse Source

String

pull/46/head
Jure Šorn 4 years ago
parent
commit
603ad8577c
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -344,7 +344,7 @@ String
| isdecimal() | | | | | yes |
+---------------+----------+----------+----------+----------+----------+
```
* **Also: `'isspace()'` checks for `'[ \t\n\r…]'`.**
* **Also: `'isspace()'` checks for `'[ \t\n\r\f\v…]'`.**
Regex
@ -380,7 +380,7 @@ import re
* **Use capital letter for negation.**
```python
'\d' == '[0-9]' # Matches any digit.
'\s' == '[ \t\n\r\f\v]' # Matches any whitespace.
'\s' == '[ \t\n\r\f\v]' # Matches any whitespace.
'\w' == '[a-zA-Z0-9_]' # Matches any alphanumeric.
```

4
index.html

@ -454,7 +454,7 @@ to_exclusive = <range>.stop
</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>
<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\f\v…]'</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
&lt;str&gt; = re.sub(&lt;regex&gt;, new, text, count=<span class="hljs-number">0</span>) <span class="hljs-comment"># Substitutes all occurrences with 'new'.</span>
@ -484,7 +484,7 @@ to_exclusive = &lt;range&gt;.stop
<li><strong>By default digits, whitespaces and alphanumerics from all alphabets are matched, unless <code class="python hljs"><span class="hljs-string">'flags=re.ASCII'</span></code> argument is used.</strong></li>
<li><strong>Use capital letter for negation.</strong></li>
</ul><pre><code class="python language-python hljs"><span class="hljs-string">'\d'</span> == <span class="hljs-string">'[0-9]'</span> <span class="hljs-comment"># Matches any digit.</span>
<span class="hljs-string">'\s'</span> == <span class="hljs-string">'[ \t\n\r\f\v]'</span> <span class="hljs-comment"># Matches any whitespace.</span>
<span class="hljs-string">'\s'</span> == <span class="hljs-string">'[ \t\n\r\f\v]'</span> <span class="hljs-comment"># Matches any whitespace.</span>
<span class="hljs-string">'\w'</span> == <span class="hljs-string">'[a-zA-Z0-9_]'</span> <span class="hljs-comment"># Matches any alphanumeric.</span>
</code></pre></div>

Loading…
Cancel
Save