I would like to split thanks to shlex this kind of string:
str = 'This doesn''t work' 54e+5 15 .FALSE. 'Another example of "test"'
Result expected:
- This doesn''t work
- 54e+5
- 15
- .FALSE.
- Another example of "test"
My main issue is that the syntax uses double simple quotes '' inside a quoted string. I cannot get shlex to work. I tried the following settings:
lex = shlex.shlex(str)
lex.whitespace_split = True
lex.quotes = "'"
But it splits between the '' even if there is no whitespace character.
Thank you !!