local path = "C://data//file.text"
local function getParentPath(_path)
pattern = "^(.-)([/\\]+)([^/\\]+)$"
i,j,k = string.match(path,pattern)
return i,j,k
end
print(getParentPath(path))
bG9jYWwgcGF0aCA9ICJDOi8vZGF0YS8vZmlsZS50ZXh0IgoKbG9jYWwgZnVuY3Rpb24gZ2V0UGFyZW50UGF0aChfcGF0aCkKCiAgICBwYXR0ZXJuID0gIl4oLi0pKFsvXFxdKykoW14vXFxdKykkIgogICAgaSxqLGsgPSBzdHJpbmcubWF0Y2gocGF0aCxwYXR0ZXJuKQogICAgcmV0dXJuIGksaixrCgplbmQKCnByaW50KGdldFBhcmVudFBhdGgocGF0aCkp