Browse Source

Regex

pull/36/head
Jure Šorn 5 years ago
parent
commit
0df8f2eb14
2 changed files with 4 additions and 2 deletions
  1. 3
      README.md
  2. 3
      index.html

3
README.md

@ -353,6 +353,7 @@ import re
```
* **Argument `'flags=re.IGNORECASE'` can be used with all functions.**
* **Argument `'flags=re.MULTILINE'` makes `'^'` and `'$'` match the start/end of each line.**
* **Argument `'flags=re.DOTALL'` makes dot also accept newline.**
* **Use `r'\1'` or `'\\1'` for backreference.**
* **Use `'?'` to make an operator non-greedy.**
@ -931,7 +932,7 @@ class <name>:
return cls.__name__
```
* **Return value of repr() should be unambiguous and of str() readable.**
* **If only repr() is defined, it will also be used for str().**
* **If only repr() is defined, it will be also used for str().**
#### Str() use cases:
```python

3
index.html

@ -446,6 +446,7 @@ to_exclusive = &lt;range&gt;.stop
</code></pre>
<ul>
<li><strong>Argument <code class="python hljs"><span class="hljs-string">'flags=re.IGNORECASE'</span></code> can be used with all functions.</strong></li>
<li><strong>Argument <code class="python hljs"><span class="hljs-string">'flags=re.MULTILINE'</span></code> makes <code class="python hljs"><span class="hljs-string">'^'</span></code> and <code class="python hljs"><span class="hljs-string">'$'</span></code> match the start/end of each line.</strong></li>
<li><strong>Argument <code class="python hljs"><span class="hljs-string">'flags=re.DOTALL'</span></code> makes dot also accept newline.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">r'\1'</span></code> or <code class="python hljs"><span class="hljs-string">'\\1'</span></code> for backreference.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'?'</span></code> to make an operator non-greedy.</strong></li>
@ -889,7 +890,7 @@ creature = Creature(Point(<span class="hljs-number">0</span>, <span class="hljs
</code></pre>
<ul>
<li><strong>Return value of repr() should be unambiguous and of str() readable.</strong></li>
<li><strong>If only repr() is defined, it will also be used for str().</strong></li>
<li><strong>If only repr() is defined, it will be also used for str().</strong></li>
</ul>
<h4 id="strusecases">Str() use cases:</h4>
<pre><code class="python language-python hljs">print(&lt;el&gt;)

Loading…
Cancel
Save