Merge pull request #224 from baihu/patch-1

Update p07_specify_regexp_for_shortest_match.rst
This commit is contained in:
XiongNeng
2018-03-09 15:45:05 +08:00
committed by GitHub

View File

@@ -16,7 +16,7 @@
.. code-block:: python .. code-block:: python
>>> str_pat = re.compile(r'\"(.*)\"') >>> str_pat = re.compile(r'"(.*)"')
>>> text1 = 'Computer says "no."' >>> text1 = 'Computer says "no."'
>>> str_pat.findall(text1) >>> str_pat.findall(text1)
['no.'] ['no.']
@@ -33,7 +33,7 @@
.. code-block:: python .. code-block:: python
>>> str_pat = re.compile(r'\"(.*?)\"') >>> str_pat = re.compile(r'"(.*?)"')
>>> str_pat.findall(text2) >>> str_pat.findall(text2)
['no.', 'yes.'] ['no.', 'yes.']
>>> >>>