Fix the "Finding all Adverbs" example (GH-21420) (#28840)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit dbd62e74da)

Co-authored-by: Rim Chatti <chattiriim@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-10-10 14:43:58 -07:00 committed by GitHub
parent e4fcb6fd3d
commit 5f44bb28fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1572,7 +1572,7 @@ find all of the adverbs in some text, they might use :func:`findall` in
the following manner::
>>> text = "He was carefully disguised but captured quickly by police."
>>> re.findall(r"\w+ly", text)
>>> re.findall(r"\w+ly\b", text)
['carefully', 'quickly']
@ -1586,7 +1586,7 @@ a writer wanted to find all of the adverbs *and their positions* in
some text, they would use :func:`finditer` in the following manner::
>>> text = "He was carefully disguised but captured quickly by police."
>>> for m in re.finditer(r"\w+ly", text):
>>> for m in re.finditer(r"\w+ly\b", text):
... print('%02d-%02d: %s' % (m.start(), m.end(), m.group(0)))
07-16: carefully
40-47: quickly