How to get name with LUA expression from path

Viewed 27

I have a string below

local x = "/archive/testing_Android.Users activity.log"

local name = x:match"^.+/(.+).log$":gsub('%testing_=', '')

print(name)

it returns testing_Android.Users activity while i want to get only Android.Users activity How can i achieve that?

1 Answers
local x = "/archive/testing_Android.Users activity.log"

local name = x:match"/testing_(.*).log"
print(name)
Related