Browse Source

Regex

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

10
README.md

@ -263,11 +263,6 @@ String
Regex Regex
----- -----
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**
* **Parameter `'flags=re.DOTALL'` makes dot also accept newline.**
* **Use `r'\1'` or `'\\\\1'` for backreference.**
* **Use `'?'` to make operators non-greedy.**
```python ```python
import re import re
<str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences. <str> = re.sub(<regex>, new, text, count=0) # Substitutes all occurrences.
@ -278,6 +273,11 @@ import re
<Matches> = re.finditer(<regex>, text) # Searches for all occurrences of pattern. <Matches> = re.finditer(<regex>, text) # Searches for all occurrences of pattern.
``` ```
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**
* **Parameter `'flags=re.DOTALL'` makes dot also accept newline.**
* **Use `r'\1'` or `'\\\\1'` for backreference.**
* **Use `'?'` to make operators non-greedy.**
### Match Object ### Match Object
```python ```python
<str> = <Match>.group() # Whole match. <str> = <Match>.group() # Whole match.

Loading…
Cancel
Save