human
Splitting strings in python
assistant
Here is some code to split a string 's' by space while ignoring spaces within square braces and quotes.

re.findall('\\[[^\\]]*\\]|"[^"]*"|\\S+', s)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.