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
1572
1572
the following manner::
1573
1573
1574
1574
>>> 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)
1576
1576
['carefully', 'quickly']
1577
1577
1578
1578
@@ -1586,7 +1586,7 @@ a writer wanted to find all of the adverbs *and their positions* in
1586
1586
some text, they would use :func: `finditer ` in the following manner::
1587
1587
1588
1588
>>> 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):
1590
1590
... print('%02d-%02d: %s' % (m.start(), m.end(), m.group(0)))
1591
1591
07-16: carefully
1592
1592
40-47: quickly
You can’t perform that action at this time.
0 commit comments