正则表达式中出现AttributeError: 'NoneType' object has no attribute 'group'问题

在运用正则表达式作匹配的过程当中可能会出现如:AttributeError: 'NoneType' object has no attribute 'group'的错误,这主要是因为没有匹配到元素,以后又调用了group()方法形成的。python import re content = 'hello world' result = re.match('^w.*d$', content)#这是想
相关文章
相关标签/搜索