How can I find all matches to a regular expression in Python?

PythonServer Side ProgrammingProgramming

We use re.findall or re.finditer methods to find all matches to a regular method.

re.findall(pattern, string) returns a list of matching strings.

re.finditer(pattern, string) returns an iterator over MatchObject object

raja
Published on 11-Jan-2018 15:17:30
Advertisements