python regex return all match objects code example
Example 1: find all regex matches python
matches = re.findall(r"xxx|yyy", a_string)
Example 2: searching for a pattern in text with re python
import re
xx = "guru99,education is fun"
r1 = re.findall(r"^\w+",xx)
print(r1)