From 54fd9d7e3036af1ade7816608a6c871fdd368ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 27 Apr 2018 16:37:05 +0200 Subject: [PATCH] Regex --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1dc653f..408de6b 100644 --- a/README.md +++ b/README.md @@ -173,9 +173,8 @@ str.replace(text, old, new) ### Print ```python -print( [, , end='', sep='', file=]) +print( [, , end='', sep='', file=]) # Use 'file=sys.stderr' for err. ``` -**For stderr use 'file=sys.stderr'** ### Regex @@ -189,9 +188,12 @@ re.split(, 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.