import re str = "Welcome to Aimtocode online learning" matched = re.search("Aimtocode", str) print(type(matched)) print(matched) #matched is the search object