import rep = re.compile(r'([A-Za-z]+?)(?:Suff)?\b')test_str = "textSuff more words tSuff"print(re.findall(p, test_str))
Standard input is empty
['text', 'more', 'words', 't']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!