I wanted to remove strings in a file (a code file in which all strings are quotations) like this:
text = "Hello,"+Tom+"have a nice day!"
text2 = "Thank"+"you."
I want this (not just quotas but everything that's inside):
['text', 'Tom','text2']
I could achieve getting every string using regular expressions, and its read line by line:
readLine = re.findall("[a-zA-Z0-9]*", line)
# there is some trimming I didn't show
But the result is:
['text','Hello','Tom','have', 'a', 'nice', 'day', 'text2', 'Thank', 'you']
If regex is not suitable, what are other ways? Any help is appreciated.