我知道这是一个经常被问到的问题,但它快把我逼疯了。在
我想使用正则表达式来匹配字符串中的子字符串。在
line = '##ParameterValue[part I care about]=garbagegarbage'
我想提取part I care about
。
我的代码如下:
但这给了我一个AttributeError: 'NoneType' object has no attribute 'group'
我在regex101上测试了我的regex,它工作了。我不明白为什么这对我来说失败了。在
将
match
更改为search
相关问题 更多 >
编程相关推荐