diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 9db6f1da3be4db..c95b88b97ddf10 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1808,7 +1808,7 @@ one as :func:`search` does. For example, if a writer wanted to 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." + >>> text = "He was carefully disguised but found quickly by police." >>> re.findall(r"\w+ly\b", text) ['carefully', 'quickly'] @@ -1822,11 +1822,11 @@ instead of strings. Continuing with the previous example, if 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." + >>> text = "He was carefully disguised but found quickly by police." >>> 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 + 37-44: quickly Raw String Notation