Skip to content

Commit 317d9a6

Browse files
committed
Regex
1 parent ec462fa commit 317d9a6

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ import re
350350
<iter> = re.finditer(<regex>, text) # Returns all occurrences as match objects.
351351
```
352352

353-
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**
354-
* **Parameter `'flags=re.DOTALL'` makes dot also accept newline.**
353+
* **Argument `'flags=re.IGNORECASE'` can be used with all functions.**
354+
* **Argument `'flags=re.DOTALL'` makes dot also accept newline.**
355355
* **Use `r'\1'` or `'\\1'` for backreference.**
356356
* **Use `'?'` to make an operator non-greedy.**
357357

@@ -365,7 +365,8 @@ import re
365365
```
366366

367367
### Special Sequences
368-
**Expressions below hold true for strings that contain only ASCII characters. Use capital letters for negation.**
368+
* **By default digits, whitespaces and alphanumerics from all alphabets are matched, unless `'flags=re.ASCII'` argument is used.**
369+
* **Use capital letters for negation.**
369370
```python
370371
'\d' == '[0-9]' # Digit
371372
'\s' == '[ \t\n\r\f\v]' # Whitespace
@@ -1960,7 +1961,7 @@ except <exception>:
19601961
```
19611962

19621963
### Rotation
1963-
**Parameter that sets a condition when a new log file is created.**
1964+
**Argument that sets a condition when a new log file is created.**
19641965
```python
19651966
rotation=<int>|<datetime.timedelta>|<datetime.time>|<str>
19661967
```

index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ <h2 id="regex"><a href="#regex" name="regex">#</a>Regex</h2>
441441
&lt;iter&gt; = re.finditer(&lt;regex&gt;, text) <span class="hljs-comment"># Returns all occurrences as match objects.</span>
442442
</code></pre>
443443
<ul>
444-
<li><strong>Parameter <code class="python hljs"><span class="hljs-string">'flags=re.IGNORECASE'</span></code> can be used with all functions.</strong></li>
445-
<li><strong>Parameter <code class="python hljs"><span class="hljs-string">'flags=re.DOTALL'</span></code> makes dot also accept newline.</strong></li>
444+
<li><strong>Argument <code class="python hljs"><span class="hljs-string">'flags=re.IGNORECASE'</span></code> can be used with all functions.</strong></li>
445+
<li><strong>Argument <code class="python hljs"><span class="hljs-string">'flags=re.DOTALL'</span></code> makes dot also accept newline.</strong></li>
446446
<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>
447447
<li><strong>Use <code class="python hljs"><span class="hljs-string">'?'</span></code> to make an operator non-greedy.</strong></li>
448448
</ul>
@@ -454,7 +454,10 @@ <h3 id="matchobject">Match Object</h3>
454454
&lt;int&gt; = &lt;Match&gt;.end() <span class="hljs-comment"># Exclusive end index of a match.</span>
455455
</code></pre>
456456
<h3 id="specialsequences">Special Sequences</h3>
457-
<p><strong>Expressions below hold true for strings that contain only ASCII characters. Use capital letters for negation.</strong></p>
457+
<ul>
458+
<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>
459+
<li><strong>Use capital letters for negation.</strong></li>
460+
</ul>
458461
<pre><code class="python language-python hljs"><span class="hljs-string">'\d'</span> == <span class="hljs-string">'[0-9]'</span> <span class="hljs-comment"># Digit</span>
459462
<span class="hljs-string">'\s'</span> == <span class="hljs-string">'[ \t\n\r\f\v]'</span> <span class="hljs-comment"># Whitespace</span>
460463
<span class="hljs-string">'\w'</span> == <span class="hljs-string">'[a-zA-Z0-9_]'</span> <span class="hljs-comment"># Alphanumeric</span>
@@ -1654,7 +1657,7 @@ <h3 id="exceptions-1">Exceptions</h3>
16541657
logger.exception(<span class="hljs-string">'An error happened.'</span>)
16551658
</code></pre>
16561659
<h3 id="rotation">Rotation</h3>
1657-
<p><strong>Parameter that sets a condition when a new log file is created.</strong></p>
1660+
<p><strong>Argument that sets a condition when a new log file is created.</strong></p>
16581661
<pre><code class="python language-python hljs">rotation=&lt;int&gt;|&lt;datetime.timedelta&gt;|&lt;datetime.time&gt;|&lt;str&gt;
16591662
</code></pre>
16601663
<ul>

0 commit comments

Comments
 (0)