File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1572,7 +1572,7 @@ find all of the adverbs in some text, they might use :func:`findall` in
15721572the following manner::
15731573
15741574 >>> text = "He was carefully disguised but captured quickly by police."
1575- >>> re.findall(r"\w+ly", text)
1575+ >>> re.findall(r"\w+ly\b ", text)
15761576 ['carefully', 'quickly']
15771577
15781578
@@ -1586,7 +1586,7 @@ a writer wanted to find all of the adverbs *and their positions* in
15861586some text, they would use :func: `finditer ` in the following manner::
15871587
15881588 >>> text = "He was carefully disguised but captured quickly by police."
1589- >>> for m in re.finditer(r"\w+ly", text):
1589+ >>> for m in re.finditer(r"\w+ly\b ", text):
15901590 ... print('%02d-%02d: %s' % (m.start(), m.end(), m.group(0)))
15911591 07-16: carefully
15921592 40-47: quickly
You can’t perform that action at this time.
0 commit comments