regexp = re.compile("name(.*)$") print regexp.search(s).group(1) # prints " is ryan, and i am new to python and would like to learn more"