【发布时间】:2014-01-10 17:41:54
【问题描述】:
我正在寻找一个组合,但它不起作用
>>> whole = ('\n1. WIPO is located at\n(A) New York\n(B) London\n(C) Geneva\n(D) Paris\n')
>>> match = re.findall('1\.\s(\w+\s)+\w+\n', whole)
>>> print(match)
['located']
我希望它返回"1. WIPO is located at\n"。但它只是返回['located ']
【问题讨论】:
标签: python regex string python-2.7