【发布时间】:2009-03-05 10:13:47
【问题描述】:
我在 python 中尝试以下正则表达式,但它返回错误
import re
...
#read a line from a file to variable line
# loking for the pattern 'WORD' in the line ...
m=re.search('(?<=[WORD])\w+',str(line))
m.group(0)
我收到以下错误:
AttributeError: 'NoneType' 对象没有属性 'group'
【问题讨论】: