demo_regex_findall.py:
import re #Return a list containing every occurrence of "ai": str = "The rain in Spain" x = re.findall("ai", str) print(x)
➜ begtut>python demo_regex_findall.py
['ai', 'ai']