import re #match a word at the beginning of a string result = re.match('Analytics',r'Analytics Vidhya is the largest data science community of India') print(result)