local filepath = "c:\\temp\\parentdir"
local dirname = string.match(filepath, "[^\\]+$")
print(dirname)
Above code is giving correct output: parentdir
Then if I use same code but only single "\" as below
local filepath = "c:\temp\parentdir"
local dirname = string.match(filepath, "[^\\]+$")
print(dirname)
I'm getting this error
"lua: main.lua:1: invalid escape sequence near '"c: emp\p'"
please help. How we can solve this issue programatically