# credit to the Stack Overflow user in the source link import re re.findall('"([^"]*)"', 'SetVariables "a" "b" "c" ') >>> ['a', 'b', 'c']