Lua字符串匹配带条件

有谁能排除这个问题吗?我弄不明白为什么if语句是false,而且运行时没有打印d1。

channel = "2.245"
d1, d2, d3, d4, d5 = channel:match("(.)(.)(.)(.)(.)")
if (d1==2) then
    print (d1)
end
print (d1)
print (d2)
print (d3)
print (d4)
print (d5)
点赞