From b8b80a5e7988d3b567448ecbb7660293e99bf9cf Mon Sep 17 00:00:00 2001 From: baihu Date: Thu, 8 Mar 2018 21:14:00 +0800 Subject: [PATCH] Update p07_specify_regexp_for_shortest_match.rst row 19: str_pat = re.compile(r'\"(.*)\"') should be str_pat = re.compile(r'"(.*)"') row 36: str_pat = re.compile(r'\"(.*?)\"') should be str_pat = re.compile(r'"(.*?)"') "\" just don't works. --- source/c02/p07_specify_regexp_for_shortest_match.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/c02/p07_specify_regexp_for_shortest_match.rst b/source/c02/p07_specify_regexp_for_shortest_match.rst index 45601979..f4da99f7 100644 --- a/source/c02/p07_specify_regexp_for_shortest_match.rst +++ b/source/c02/p07_specify_regexp_for_shortest_match.rst @@ -16,7 +16,7 @@ .. code-block:: python - >>> str_pat = re.compile(r'\"(.*)\"') + >>> str_pat = re.compile(r'"(.*)"') >>> text1 = 'Computer says "no."' >>> str_pat.findall(text1) ['no.'] @@ -33,7 +33,7 @@ .. code-block:: python - >>> str_pat = re.compile(r'\"(.*?)\"') + >>> str_pat = re.compile(r'"(.*?)"') >>> str_pat.findall(text2) ['no.', 'yes.'] >>>