Skip to content

Commit 77d6245

Browse files
committed
Regex
1 parent 85b707a commit 77d6245

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ Regex
287287
-----
288288
```python
289289
import re
290-
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences.
291-
<list> = re.findall(<regex>, text) # Returns all occurrences.
292-
<list> = re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches.
293-
<Match> = re.search(<regex>, text) # Searches for first occurrence of pattern.
294-
<Match> = re.match(<regex>, text) # Searches only at the beginning of the text.
295-
<iter> = re.finditer(<regex>, text) # Returns all occurrences as match objects.
290+
<str> = re.sub('<regex>', new, text, count=0) # Substitutes all occurrences.
291+
<list> = re.findall('<regex>', text) # Returns all occurrences.
292+
<list> = re.split('<regex>', text, maxsplit=0) # Use brackets in regex to keep the matches.
293+
<Match> = re.search('<regex>', text) # Searches for first occurrence of pattern.
294+
<Match> = re.match('<regex>', text) # Searches only at the beginning of the text.
295+
<iter> = re.finditer('<regex>', text) # Returns all occurrences as match objects.
296296
```
297297

298298
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**
@@ -312,9 +312,9 @@ import re
312312
### Special Sequences
313313
**Expressions below hold true for strings that contain only ASCII characters. Use capital letters for negation.**
314314
```python
315-
'\d' == '[0-9]' # Digit
316-
'\s' == '[ \t\n\r\f\v]' # Whitespace
317-
'\w' == '[a-zA-Z0-9_]' # Alphanumeric
315+
'\d' == '[0-9]' # Digit
316+
'\s' == '[ \t\n\r\f\v]' # Whitespace
317+
'\w' == '[a-zA-Z0-9_]' # Alphanumeric
318318
```
319319

320320

0 commit comments

Comments
 (0)