Run
import re pattern = 'aba' string = 'ababaiiaba' result = re.findall(pattern, string) print(result)
Output