re.finditer() in Python
re.finditer() method in Python is used to search for all matches of a pattern in a string and return them as an iterator. In this article, we will explore about re.finditer() method in Python.Let's understand this with the help of an example:Pythonimport re text = "GFG, O, B, GFG, O" pattern = "GFG"