Browse Source

Regex

pull/10/head
Jure Šorn 5 years ago
parent
commit
6f4e461754
1 changed files with 6 additions and 6 deletions
  1. 12
      README.md

12
README.md

@ -265,12 +265,12 @@ Regex
-----
```python
import re
<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.
<Match> = re.search(<regex>, text) # Searches for first occurrence of pattern.
<Match> = re.match(<regex>, text) # Searches only at the beginning of the text.
<Matches> = re.finditer(<regex>, text) # Searches for all occurrences of pattern.
<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.
<Match> = re.search(<regex>, text) # Searches for first occurrence of pattern.
<Match> = re.match(<regex>, text) # Searches only at the beginning of the text.
<iter> = re.finditer(<regex>, text) # Returns iterator of all matches.
```
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**

Loading…
Cancel
Save