Browse Source

List and regex

pull/36/head
Jure Šorn 6 years ago
parent
commit
06f54c7fb7
2 changed files with 7 additions and 3 deletions
  1. 5
      README.md
  2. 5
      index.html

5
README.md

@ -59,7 +59,7 @@ index = <list>.index(<el>) # Returns first index of item.
<list>.insert(index, <el>) # Inserts item at index and moves the rest to the right.
<el> = <list>.pop([index]) # Removes and returns item at index or from the end.
<list>.remove(<el>) # Removes first occurrence of item or raises ValueError.
<list>.clear() # Removes all items.
<list>.clear() # Removes all items. Also works on dict and set.
```
@ -324,6 +324,9 @@ import re
<str> = <Match>.group() # Whole match.
<str> = <Match>.group(1) # Part in first bracket.
<tuple> = <Match>.groups() # All bracketed parts.
```
```python
<int> = <Match>.start() # Start index of a match.
<int> = <Match>.end() # Exclusive end index of a match.
```

5
index.html

@ -241,7 +241,7 @@ list_of_chars = list(&lt;str&gt;)
&lt;list&gt;.insert(index, &lt;el&gt;) <span class="hljs-comment"># Inserts item at index and moves the rest to the right.</span>
&lt;el&gt; = &lt;list&gt;.pop([index]) <span class="hljs-comment"># Removes and returns item at index or from the end.</span>
&lt;list&gt;.remove(&lt;el&gt;) <span class="hljs-comment"># Removes first occurrence of item or raises ValueError.</span>
&lt;list&gt;.clear() <span class="hljs-comment"># Removes all items.</span>
&lt;list&gt;.clear() <span class="hljs-comment"># Removes all items. Also works on dict and set.</span>
</code></pre>
<h2 id="dictionary"><a href="#dictionary" name="dictionary">#</a>Dictionary</h2>
<pre><code class="python language-python hljs">&lt;view&gt; = &lt;dict&gt;.keys() <span class="hljs-comment"># Coll. of keys that reflects changes.</span>
@ -419,7 +419,8 @@ Point(x=<span class="hljs-number">1</span>, y=<span class="hljs-number">2</span>
<pre><code class="python language-python hljs">&lt;str&gt; = &lt;Match&gt;.group() <span class="hljs-comment"># Whole match.</span>
&lt;str&gt; = &lt;Match&gt;.group(<span class="hljs-number">1</span>) <span class="hljs-comment"># Part in first bracket.</span>
&lt;tuple&gt; = &lt;Match&gt;.groups() <span class="hljs-comment"># All bracketed parts.</span>
&lt;int&gt; = &lt;Match&gt;.start() <span class="hljs-comment"># Start index of a match.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;int&gt; = &lt;Match&gt;.start() <span class="hljs-comment"># Start index of a match.</span>
&lt;int&gt; = &lt;Match&gt;.end() <span class="hljs-comment"># Exclusive end index of a match.</span>
</code></pre>
<h3 id="specialsequences">Special Sequences</h3>

|||||||
100:0
Loading…
Cancel
Save