Extract last part of a string in Lua

Viewed 1493

I need to extract the last part of a string like this,

http://development.dest/show/images-345/name/289/

I only need this part 289, I tried using string.match with the next pattern.

string.match(url, "(%d+)(\/)$")

And I get this error in error log,

2017/05/22 20:53:04 [error] 31264#0: *5 failed to load external Lua file

I think the last part of the pattern is wrong, but I don't know how to fix it ((\/)).

2 Answers
Related