# re.sub 会得到一个替换后的新的字符串,原本字符串保持不变
import re
data_str = 'xcopy /s “C:program files” “d:”'
ret_string = re.sub('“(.*?)”', '', data_str)
print('ret_string: {}'.format(ret_string))
ret_list = ret_string.strip().split(' ')
print('ret_list: {}'.format(ret_list))
ret_string: xcopy /s
ret_list: ['xcopy', '/s']