import re list1 = ["guru99 get", "guru99 give", "guru Selenium"] for element in list1: z = """re.match("(g\\w+