@@ -287,12 +287,12 @@ Regex
287
287
-----
288
288
``` python
289
289
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.
296
296
```
297
297
298
298
* ** Parameter ` 'flags=re.IGNORECASE' ` can be used with all functions.**
@@ -312,9 +312,9 @@ import re
312
312
### Special Sequences
313
313
** Expressions below hold true for strings that contain only ASCII characters. Use capital letters for negation.**
314
314
``` 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
318
318
```
319
319
320
320
0 commit comments