Skip to content

Commit b8b80a5

Browse files
authored
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.
1 parent bec08b4 commit b8b80a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/c02/p07_specify_regexp_for_shortest_match.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
.. code-block:: python
1818
19-
>>> str_pat = re.compile(r'\"(.*)\"')
19+
>>> str_pat = re.compile(r'"(.*)"')
2020
>>> text1 = 'Computer says "no."'
2121
>>> str_pat.findall(text1)
2222
['no.']
@@ -33,7 +33,7 @@
3333

3434
.. code-block:: python
3535
36-
>>> str_pat = re.compile(r'\"(.*?)\"')
36+
>>> str_pat = re.compile(r'"(.*?)"')
3737
>>> str_pat.findall(text2)
3838
['no.', 'yes.']
3939
>>>

0 commit comments

Comments
 (0)