diff --git a/README.md b/README.md index 9a528b4..bcd9953 100644 --- a/README.md +++ b/README.md @@ -198,13 +198,20 @@ import re = re.finditer(, text) # Searches for all occurences of pattern. ``` -* **Use '.group()' method on Match object it to get the whole match, or '.group(1)' to get the part in first bracket.** +#### Match Object +```python + = .group() # Whole match. + = .group(1) # Part in first bracket. + = .start() # Start index of a match. + = .end() # Exclusive end index of a match. +``` + * **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.** * **Use ? to make operators non-greedy.** -#### Special Sequences: +#### Special sequences: ```python # Use capital letter for negation. '\d' == '[0-9]' # Digit @@ -258,7 +265,7 @@ textwrap.wrap(text, width) Numbers ------- -### Basic functions +### Basic Functions ```python round([, ndigits]) abs() @@ -661,7 +668,7 @@ Bytes = .hex() ``` -### Read Bytes from file +### Read Bytes from File ```python def read_bytes(filename): with open(filename, 'rb') as file: