fork(7) download
  1. local path = "C://data//file.text"
  2.  
  3. local function getParentPath(_path)
  4.  
  5. pattern = "^(.-)([/\\]+)([^/\\]+)$"
  6. i,j,k = string.match(path,pattern)
  7. return i,j,k
  8.  
  9. end
  10.  
  11. print(getParentPath(path))
Success #stdin #stdout 0s 2788KB
stdin
Standard input is empty
stdout
C://data	//	file.text