【发布时间】:2013-11-09 15:26:24
【问题描述】:
我需要 Python 正则表达式的帮助来提取单引号或双引号内的字符串。我找到了一个解决方案,但正则表达式在 C# 中:
How to extract the string in the quotes (either double quotes or single quotes)
我需要解析这个字符串
tags = { 'one' : "two", "three", 'four' }
并返回数组项:
one
two
three
four
目前我有这个单引号:
quoted = re.findall(r"'(.*?)'", buffer, re.DOTALL)
【问题讨论】:
标签: python regex string quotes findall