From 9ac70aee69dfd515f936a986c62a66caf2547cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 4 Apr 2018 19:49:22 +0200 Subject: [PATCH] Regex --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be9e719..7111370 100644 --- a/README.md +++ b/README.md @@ -162,14 +162,15 @@ print( [, , end='', sep='', file=]) ```python import re re.sub(, new, text, count=0) -re.search(, text) # Searches for first occurance of pattern. +re.search(, text) # Searches for first occurrence of pattern. re.match(, text) # Searches only at the beginning of the string. re.findall(, text) 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 match.** -**Parameter 'flags=re.IGNORECASE' can be used with all functions.** +**Parameter 'flags=re.IGNORECASE' can be used with all functions.** +**Parameter 'flags=re.DOTALL' makes dot also accept newline. **Use r'\1' for backreference.** #### Special Sequences: