Bite 155. Split a string by spaces or quoted text

Another text manipulation Bite. Code split_words_and_quoted_text that takes a text string and splits it by space, except words that are wrapped between double quotes ("), these spaces needs to be preserved.

So passing it Should give "3 words only", it would return a list of 3 (not 5) elements: ['Should', 'give', '3 words only'] (note that the double quotes are stripped off as well).

Check out the standard library, there might be a tool for the job ;) - good luck and keep calm and code in Python!

Will you be Pythonista #20 to crack this Bite?
Average Bite difficulty 1-10 rating: 3.0
» You can do it! 😌

Github login button
We use Python 3.7