import res = 'I like bla blab blah chocolate I like bla blob bla cheese'print( re.findall(r'\b(I like)\b.*?(\w+)(?=\s*(?:\bI like\b|$))', s) )
Standard input is empty
[('I like', 'chocolate'), ('I like', 'cheese')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!