How do I pattern match these URI's? I need to string match whatever characters are between the first and second slash (1) or any characters that are present after the first slash (2) or just /
(3).
Note the trailing slash in the first example.
(1)
/resource/_another-resource
(2)
/_resource
(3)
/
I have uri_resource = uri:match('^%/(.-)%/')
which takes care of example 1 but will fail if no trailing slash is present.