Skip to content

Commit 86ba745

Browse files
committed
Regex
1 parent 891ea1f commit 86ba745

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ Regex
351351
-----
352352
```python
353353
import re
354-
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences.
355-
<list> = re.findall(<regex>, text) # Returns all occurrences.
354+
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences of the pattern.
355+
<list> = re.findall(<regex>, text) # Returns all occurrences of the pattern.
356356
<list> = re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches.
357-
<Match> = re.search(<regex>, text) # Searches for first occurrence of pattern.
357+
<Match> = re.search(<regex>, text) # Searches for first occurrence of the pattern.
358358
<Match> = re.match(<regex>, text) # Searches only at the beginning of the text.
359359
<iter> = re.finditer(<regex>, text) # Returns all occurrences as match objects.
360360
```

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,10 @@
457457
<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>
458458
</ul>
459459
<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
460-
&lt;str&gt; = re.sub(&lt;regex&gt;, new, text, count=<span class="hljs-number">0</span>) <span class="hljs-comment"># Substitutes all occurrences.</span>
461-
&lt;list&gt; = re.findall(&lt;regex&gt;, text) <span class="hljs-comment"># Returns all occurrences.</span>
460+
&lt;str&gt; = re.sub(&lt;regex&gt;, new, text, count=<span class="hljs-number">0</span>) <span class="hljs-comment"># Substitutes all occurrences of the pattern.</span>
461+
&lt;list&gt; = re.findall(&lt;regex&gt;, text) <span class="hljs-comment"># Returns all occurrences of the pattern.</span>
462462
&lt;list&gt; = re.split(&lt;regex&gt;, text, maxsplit=<span class="hljs-number">0</span>) <span class="hljs-comment"># Use brackets in regex to keep the matches.</span>
463-
&lt;Match&gt; = re.search(&lt;regex&gt;, text) <span class="hljs-comment"># Searches for first occurrence of pattern.</span>
463+
&lt;Match&gt; = re.search(&lt;regex&gt;, text) <span class="hljs-comment"># Searches for first occurrence of the pattern.</span>
464464
&lt;Match&gt; = re.match(&lt;regex&gt;, text) <span class="hljs-comment"># Searches only at the beginning of the text.</span>
465465
&lt;iter&gt; = re.finditer(&lt;regex&gt;, text) <span class="hljs-comment"># Returns all occurrences as match objects.</span>
466466
</code></pre></div>

0 commit comments

Comments
 (0)