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']
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