这是一个创建于 4393 天前的主题,其中的信息可能已经有所发展或是发生改变。
在循环里进行正则表达式匹配的时候,经常出现没有理由的匹配失败,例如
try
match = re.match(str)[1] # TypeError: Cannot read property '1' of null
catch error
match = re.match(str)[1] # 完全正常
求解
2 条回复 • 1970-01-01 08:00:00 +08:00
 |
|
1
bitsmix 2013-02-09 11:20:56 +08:00 via iPhone
你自己的问题。
|
 |
|
2
wsph123 2013-02-11 17:13:11 +08:00 1
match返回不一定有[1]
|