Regular-expression

explain finditer() vs findall() vs find search()

@mybusiness6382

Findall indeed finds all the matches in the given string.
findall() will iterate over all the lines of the file and will return all non-overlapping matches of pattern in a single step.

Finditer only finds the first one, returning an iterator with only one element.

search() module will only return the first occurrence that matches the specified pattern.

image

image

image