I have a string which is like this:
this is \"a test\"
I\'m trying to write something in Python to split it up by space while ignoring spac
Depending on your use case, you may also want to check out the csv module:
import csv lines = ['this is "a string"', 'and more "stuff"'] for row in csv.reader(lines, delimiter=" "): print(row)
Output:
['this', 'is', 'a string'] ['and', 'more', 'stuff']