import retext = 'This is a small example Text, showcasing my desired output.'print(re.findall(r'\W*(?:\w+\W+){1,4}', text))
Standard input is empty
['This is a small ', 'example Text, showcasing my ', 'desired output.']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!