Browse Source

Regex

pull/3/head
Jure Šorn 6 years ago
parent
commit
651886241f
1 changed files with 3 additions and 3 deletions
  1. 6
      README.md

6
README.md

@ -190,9 +190,9 @@ print(<el> [, <el>, end='', sep='', file=<file>]) # Use 'file=sys.stderr' for e
### Regex
```python
import re
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences.
<list> = re.findall(<regex>, text)
<list> = re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches.
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences.
<list> = re.findall(<regex>, text)
<list> = re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches.
<Match> = re.search(<regex>, text) # Searches for first occurrence of pattern.
<Match> = re.match(<regex>, text) # Searches only at the beginning of the string.
<Match_iter> = re.finditer(<regex>, text) # Searches for all occurences of pattern.

Loading…
Cancel
Save