|
|
@ -265,9 +265,7 @@ Regex |
|
|
|
----- |
|
|
|
```python |
|
|
|
import re |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences. |
|
|
|
<list> = re.findall(<regex>, text) # Returns all occurrences. |
|
|
|
<list> = re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches. |
|
|
@ -777,9 +775,7 @@ Enum |
|
|
|
---- |
|
|
|
```python |
|
|
|
from enum import Enum, auto |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
class <enum_name>(Enum): |
|
|
|
<member_name_1> = <value_1> |
|
|
|
<member_name_2> = <value_2_a>, <value_2_b> |
|
|
|