PyDocs

Nav

Text Processing Services

finditer

re

function (source)
  • finditer(pattern, string, flags=0)
Return an iterator over all non-overlapping matches in the
string.  For each match, the iterator returns a Match object.

Empty matches are included in the result.
Changed in 3.7
  • 3.7: Non-empty matches can now start just after a previous empty match.
1 Example
>>> text = "He was carefully disguised but captured 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
from the Python docs
See Also
No see-alsos for re/finditer
0 Notes
No notes for finditer