From 48c0541b9828018832dd41171873619b7b1aa4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 1 Apr 2018 04:42:58 +0200 Subject: [PATCH] Regex --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 20a7064..90c7cf3 100644 --- a/README.md +++ b/README.md @@ -161,14 +161,15 @@ print( [, , end='', sep='', file=]) ### Regex ```python import re -re.sub(, new, text) # Use r'\1' for backreference. -re.search(, text) +re.sub(, new, text, count=0) +re.search(, text) # Searches for first occurance of pattern. re.match(, text) # Searches only at the beginning of the string. re.findall(, text) -re.split(, text) # Use brackets in regex to keep the matches. +re.split(, text, maxsplit=0) # Use brackets in regex to keep the matches. ``` -* **Parameter 'flags=re.IGNORECASE' can be used with all functions.** +**Parameter 'flags=re.IGNORECASE' can be used with all functions.** +**Use r'\1' for backreference.** ### Format ```python