为了账号安全,请及时绑定邮箱和手机立即绑定

'str' object has no attribute 'group'为什么

import re


str1='mooc videonum=1000'

ma=re.sub(r'\d+', '1001', str1)

print ma.group()

运行结果为:AttributeError: 'str' object has no attribute 'group'

正在回答

2 回答

sub返回的是字符串

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

'str' object has no attribute 'group'为什么

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信