这是一个python代码片段:
import re
VARS='Variables: "OUTPUTFOLDER=installers","SETUP_ORDER=Product 4,Product 4 Library","SUB_CONTENTS=Product 4 Library","SUB_CONTENT_SIZES=9364256","SUB_CONTENT_GROUPS=Product 4 Library","SUB_CONTENT_DESCRIPTIONS=","SUB_CONTENT_GROUP_DESCRIPTIONS=","SUB_DISCS=Product 4,Product Disc",SUB_FILENAMES='
comp = re.findall(r'\w+=".*?"', VARS)
for var in comp:
print var
这是当前的输出:
SUB_CONTENT_DESCRIPTIONS=","
SUB_CONTENT_GROUP_DESCRIPTIONS=","
但是我希望输出提取所有元素,所以它看起来像这样:
"OUTPUTFOLDER=installers"
"SETUP_ORDER=Product 4, Product 4 Library"
"SUB_CONTENTS=Product 4"
"SUB_CONTENT_SIZES=9364256"
...
我的正则表达式模式有什么问题?