I have a need to split a series of strings into 3 component parts denoted by spaces. These strings sometimes contain sublists, but always as the last component of the string.
I was previously using Shlex to achieve this with great success, but I'm not getting the desired results anymore as my most recent sub lists contain spaces of their own and that seems to throw Shlex off.
Is there an alternative to Shlex that might perform the task better?
Some examples are:
'BREAKFAST IN ["Rolled Oats","Cornflakes","French Toast"]'
and
COPIES_FOR_EXTERNAL > "0"
Which should become lists like:
['BREAKFAST','IN', '["Rolled Oats","Cornflakes","French Toast"]']
and
['COPIES_FOR_EXTERNAL','>','"0"']