import reres = re.findall(r'^foo (\S+(?:\s+\S+)*) (\S+) baz (\d+)', 'foo hello world blah blah baz 33')print(res)
Standard input is empty
[('hello world blah', 'blah', '33')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!