From 06d4282908ff5b4dfa2e3638f83b2e623dabff17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 25 Dec 2018 19:04:16 +0100 Subject: [PATCH] Format --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4424a7f..3da12a7 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,9 @@ String print( [, , end='', sep='', file=]) # Use 'file=sys.stderr' for errors. ``` -### Regex + +Regex +----- ```python import re = re.sub(, new, text, count=0) # Substitutes all occurrences. @@ -251,7 +253,7 @@ import re * **Use '\\\\1' or r'\1' for backreference.** * **Use ? to make operators non-greedy.** -#### Match object: +### Match Object ```python = .group() # Whole match. = .group(1) # Part in first bracket. @@ -259,7 +261,7 @@ import re = .end() # Exclusive end index of a match. ``` -#### Special sequences: +### Special Sequences ```python # Use capital letter for negation. '\d' == '[0-9]' # Digit @@ -267,7 +269,9 @@ import re '\w' == '[a-zA-Z0-9_]' # Alphanumeric ``` -### Format + +Format +------ ```python # Both return ', ': = '{}, {}'.format(, )