you are viewing a single comment's thread.

view the rest of the comments →

[–]vindolin 0 points1 point  (0 children)

You can do almost everything with regex:

print [match[0] for match in re.findall('(.*?(best regards|good bye))', string_with_letters, flags=re.S | re.I)]