So far, the example patterns have all used
search() to look for single instances of literal text strings. The
findall() function returns all of the substrings of the input that match the pattern without overlapping.
This example input string includes two instances of
finditer() function returns an iterator that produces
Match instances instead of the strings returned by
This example finds the same two occurrences of
ab, and the
Match instance shows where they are found in the original input.