我有以下代码:
import re
vars='"NAME=Product","TYPE=","VERSION=1.2","VISIBILITY=","SRC=","FOLDER=TRUE","Text=foo, containing, commas"'
list = re.findall(r'\w+=".*?"', vars)
for i in range(1,len(list)):
print list[i]
输出如下所示:
VISIBILITY=","
SRC=","
但是,我想找到(拆分)所有参数,即使是那些本身包含逗号的参数。输出应如下所示:
"NAME=Product"
"TYPE="
"VERSION=1.2"
"VISIBILITY="
"SRC="
"FOLDER=TRUE"
"Text=foo, containing, commas"
我必须对我的正则表达式进行哪些更改?