Browse Source

Regex

pull/3/head
Jure Šorn 6 years ago
parent
commit
54fd9d7e30
1 changed files with 4 additions and 2 deletions
  1. 6
      README.md

6
README.md

@ -173,9 +173,8 @@ str.replace(text, old, new)
### Print
```python
print(<el> [, <el>, end='', sep='', file=<file>])
print(<el> [, <el>, end='', sep='', file=<file>]) # Use 'file=sys.stderr' for err.
```
**For stderr use 'file=sys.stderr'**
### Regex
@ -189,9 +188,12 @@ re.split(<regex>, text, maxsplit=0) # Use brackets in regex to keep the matches
```
**'Search' and 'match' functions return a 'Match' object. Use '.group()' method on it to get the whole match, or '.group(1)' to get the part in first bracket.**
**Parameter 'flags=re.IGNORECASE' can be used with all functions. Parameter 'flags=re.DOTALL' makes dot also accept newline.**
**Use '\\\\1' or r'\1' for backreference.**
#### Special Sequences:
```python
# Use capital letter for negation.

Loading…
Cancel
Save